Checkbox Card
A form component that pairs a standard checkbox state with a selectable structural card layout.Â
For more information on this component configuration, visit Radix UIÂ
Disabled
Use the disabled class to disable the component.
Sizes
Use the checkbox-card-{size} class to control the component size.
Size values can include:smmdlg.
For more information on all available sizing utilities, visit TailwindÂ
Variants
Use the variant and palette classes to control the appereance of the component.
Variant values can include solidoutlinesurfacesubtleplain.
Color palettes can include primaryneutral. For extra palettes such as warning error and more, refer to the Colors section.
Customizing
globals.css
:root {
--ex-checkbox-card-cursor: default;
--ex-checkbox-card-font-size-sm: var(--text-xs);
--ex-checkbox-card-font-size-md: var(--text-sm);
--ex-checkbox-card-font-size-lg: var(--text-base);
--ex-checkbox-card-gap-x-sm: calc(var(--spacing * 2));
--ex-checkbox-card-gap-x-md: calc(var(--spacing * 2.5));
--ex-checkbox-card-gap-x-lg: calc(var(--spacing * 3));
--ex-checkbox-card-px-sm: calc(var(--spacing * 4));
--ex-checkbox-card-px-md: calc(var(--spacing * 5));
--ex-checkbox-card-px-lg: calc(var(--spacing * 6));
--ex-checkbox-card-py-sm: calc(var(--spacing * 4));
--ex-checkbox-card-py-md: calc(var(--spacing * 5));
--ex-checkbox-card-py-lg: calc(var(--spacing * 6));
--ex-checkbox-card-radius-sm: var(--radius-sm);
--ex-checkbox-card-radius-md: var(--radius-sm);
--ex-checkbox-card-radius-lg: var(--radius-sm);
--ex-checkbox-card-content-gap-x-sm: calc(var(--spacing * 2));
--ex-checkbox-card-content-gap-x-md: calc(var(--spacing * 2.5));
--ex-checkbox-card-content-gap-x-lg: calc(var(--spacing * 3));
--ex-checkbox-card-content-gap-y-sm: calc(var(--spacing * 1));
--ex-checkbox-card-content-gap-y-md: calc(var(--spacing * 1));
--ex-checkbox-card-content-gap-y-lg: calc(var(--spacing * 1));
--ex-checkbox-card-label-font-family: var(--font-sans);
--ex-checkbox-card-label-font-weight: var(--font-weight-semibold);
--ex-checkbox-card-label-font-size-sm: var(--text-xs);
--ex-checkbox-card-label-font-size-md: var(--text-sm);
--ex-checkbox-card-label-font-size-lg: var(--text-base);
--ex-checkbox-card-description-font-family: var(--font-sans);
--ex-checkbox-card-description-font-weight: var(--font-weight-normal);
--ex-checkbox-card-description-opacity: var(--ex-options-opacity-muted);
--ex-checkbox-card-description-font-size-sm: var(--text-xs);
--ex-checkbox-card-description-font-size-md: var(--text-sm);
--ex-checkbox-card-description-font-size-lg: var(--text-base);
--ex-checkbox-card-indicator-font-size-sm: var(--text-lg);
--ex-checkbox-card-indicator-font-size-md: var(--text-xl);
--ex-checkbox-card-indicator-font-size-lg: var(--text-2xl);
--ex-checkbox-card-indicator-radius-sm: var(--radius-sm);
--ex-checkbox-card-indicator-radius-md: var(--radius-sm);
--ex-checkbox-card-indicator-radius-lg: var(--radius-sm);
}API
For more information on this component configuration, visit Radix UIÂ
Checkbox Card
| Element | Selector |
|---|---|
CheckboxCard | .ex-checkbox-card |
| Prop | Type | Default |
|---|---|---|
as | ElementType | button |
asChild | boolean | false |
checked | boolean | false |
defaultChecked | boolean | false |
disabled | boolean | false |
name | string | |
required | boolean | false |
value | string | |
onCheckedChange | function |
Checkbox Card Indicator
| Element | Selector |
|---|---|
CheckboxCard.Indicator | .ex-checkbox-card-indicator |
| Prop | Type | Default |
|---|---|---|
as | ElementType | div |
asChild | boolean | false |
forceMount | boolean | true |
Checkbox Card Content
| Element | Selector |
|---|---|
CheckboxCard.Content | .ex-checkbox-card-content |
| Prop | Type | Default |
|---|---|---|
as | ElementType | div |
asChild | boolean | false |
Checkbox Card Label
| Element | Selector |
|---|---|
CheckboxCard.Label | .ex-checkbox-card-label |
| Prop | Type | Default |
|---|---|---|
as | ElementType | label |
asChild | boolean | false |
Checkbox Card Description
| Element | Selector |
|---|---|
CheckboxCard.Description | .ex-checkbox-card-description |
| Prop | Type | Default |
|---|---|---|
as | ElementType | p |
asChild | boolean | false |
Last updated on