CheckboxCardGroup
Multi-select group of CheckboxCards presented as interactive cards.
Shares size, indicator, icon, and checked state with its items via context.
Usage
import { CheckboxCard, checkboxCardAnatomy, CheckboxCardContent, CheckboxCardDescription, CheckboxCardGroup, CheckboxCardGroupProps, CheckboxCardIcon, CheckboxCardProps, CheckboxCardTitle } from "@desk/ui/components/checkbox-card";Best practices
Use
CheckboxCardGroupfor multi-select cards andRadioCardGroupfor single-select — a checkbox group lets any number be on at once.Set
size/icon/indicatorSide/showIndicatoronce on the group; everyCheckboxCardreads them from context — don't repeat them per item.It is controlled: drive
checkedValues(astring[]) and toggle insideonCheckedChange(value, checked); the group tracks no selection internally.
Props
CheckboxCard
| Prop | Type | Default | Description |
|---|---|---|---|
| checked | CheckboxPrimitive.CheckedState | undefined | Controlled checked state | |
| defaultChecked | CheckboxPrimitive.CheckedState | undefined | Default checked state for uncontrolled usage | |
| disabled | boolean | undefined | Whether the checkbox is disabled | |
| icon | LucideIcon | React.ComponentType<React.SVGProps<SVGSVGElement>> | undefined | Icon to display as indicator (overrides group-level icon) | |
| name | string | undefined | Name for form submission | |
| onCheckedChange | ((checked: CheckboxPrimitive.CheckedState) => void) | undefined | Callback when checked state changes | |
| required | boolean | undefined | Whether the checkbox is required | |
| suffixIcon | LucideIcon | React.ComponentType<React.SVGProps<SVGSVGElement>> | undefined | Icon to display at the end of the card | |
| value | string | undefined | Value for form submission |
CheckboxCardGroup
| Prop | Type | Default | Description |
|---|---|---|---|
| checkedValues | string[] | Controlled checked values | |
| disabled | boolean | Whether the group is disabled | |
| icon | LucideIcon | React.ComponentType<React.SVGProps<SVGSVGElement>> | Icon to display instead of the indicator | |
| indicatorSide | "end" | "start" | "start" | Position of the indicator/icon. |
| name | string | Name for form submission | |
| onCheckedChange | (value: string, checked: boolean) => void | Callback when an item changes | |
| required | boolean | Whether the group is required | |
| showIndicator | boolean | true | Show the checkbox indicator on each item. |
| size | "base" | "2xs" | "xs" | "sm" | "lg" | "xl" | "2xl" | "3xl" | "base" |
Also exports
- const
checkboxCardAnatomy - component
CheckboxCardContent - component
CheckboxCardDescription - interface
CheckboxCardGroupProps - component
CheckboxCardIcon - interface
CheckboxCardProps - component
CheckboxCardTitle
Anatomy
CheckboxCardGroup
checkbox-card-groupMulti-select group of option cards
CheckboxCard
checkbox-card-itemSelectable card representing a single option
CheckboxCardIcon
checkbox-card-iconLeading icon or checkbox indicator
CheckboxCardContent
checkbox-card-contentText stack with title and description
CheckboxCardTitle
checkbox-card-titleOption label
CheckboxCardDescription
checkbox-card-descriptionSupporting detail for the option