From c7273968e926a4a47ba96f968e866ef0ec951334 Mon Sep 17 00:00:00 2001 From: mrholek Date: Thu, 29 May 2025 23:49:08 +0200 Subject: [PATCH 1/3] refactor(CButton): improve variants handling --- packages/coreui-react/src/components/button/CButton.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/coreui-react/src/components/button/CButton.tsx b/packages/coreui-react/src/components/button/CButton.tsx index a12115d5..cbb003d7 100644 --- a/packages/coreui-react/src/components/button/CButton.tsx +++ b/packages/coreui-react/src/components/button/CButton.tsx @@ -74,9 +74,10 @@ export const CButton: PolymorphicRefForwardingComponent<'button', CButtonProps> {...(!rest.href && { type: type })} className={classNames( 'btn', - variant && color ? `btn-${variant}-${color}` : `btn-${variant}`, { - [`btn-${color}`]: color && !variant, + [`btn-${variant}-${color}`]: variant && color, + [`btn-${variant}`]: variant && !color, + [`btn-${color}`]: !variant && color, [`btn-${size}`]: size, }, shape, From 38fc15aee8dd508897139954406dbccce089c808 Mon Sep 17 00:00:00 2001 From: mrholek Date: Sun, 8 Jun 2025 21:03:03 +0200 Subject: [PATCH 2/3] docs: update content --- .../docs/content/forms/checkbox/bootstrap.mdx | 68 ++++++++++--------- .../docs/content/forms/checkbox/index.mdx | 68 +++++++++---------- 2 files changed, 68 insertions(+), 68 deletions(-) diff --git a/packages/docs/content/forms/checkbox/bootstrap.mdx b/packages/docs/content/forms/checkbox/bootstrap.mdx index 185c6753..842bb911 100644 --- a/packages/docs/content/forms/checkbox/bootstrap.mdx +++ b/packages/docs/content/forms/checkbox/bootstrap.mdx @@ -1,69 +1,71 @@ --- -title: React Checkbox Components -name: Checkbox -description: Create consistent cross-browser and cross-device checkboxes with our React checkbox components. +title: React Bootstrap Checkbox Component +name: Checkbox with Bootstrap Styling +description: Learn how to build accessible and consistent Bootstrap-style checkboxes in React using CoreUI components. route: /forms/checkbox/ -other_frameworks: checkbox +bootstrap_component: true --- -## Approach +## How to use React Bootstrap Checkbox component -Browser default checkboxes and radios are replaced with the help of ``. Checkboxes are for selecting one or several options in a list. +Use CoreUI’s `` to create cross-browser, accessible, and Bootstrap-styled checkboxes in React. Checkboxes are ideal for selecting one or more options from a list and can be styled, stacked, or grouped using layout utilities. -## Checkboxes +### Basic example - +Use the `` component to render a standard Bootstrap-style checkbox. -### Indeterminate + -Checkboxes can utilize the `:indeterminate` pseudo-class when manually set via `indeterminate` property. +### Indeterminate state - +Set the `indeterminate` property to render a checkbox in an indeterminate state, commonly used to indicate partial selections. -### Disabled + -Add the `disabled` attribute and the associated `