Skip to content
← Inventory

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 CheckboxCardGroup for multi-select cards and RadioCardGroup for single-select — a checkbox group lets any number be on at once.

  • Set size/icon/indicatorSide/showIndicator once on the group; every CheckboxCard reads them from context — don't repeat them per item.

  • It is controlled: drive checkedValues (a string[]) and toggle inside onCheckedChange(value, checked); the group tracks no selection internally.

Props

CheckboxCard

PropTypeDefaultDescription
checkedCheckboxPrimitive.CheckedState | undefined

Controlled checked state

defaultCheckedCheckboxPrimitive.CheckedState | undefined

Default checked state for uncontrolled usage

disabledboolean | undefined

Whether the checkbox is disabled

iconLucideIcon | React.ComponentType<React.SVGProps<SVGSVGElement>> | undefined

Icon to display as indicator (overrides group-level icon)

namestring | undefined

Name for form submission

onCheckedChange((checked: CheckboxPrimitive.CheckedState) => void) | undefined

Callback when checked state changes

requiredboolean | undefined

Whether the checkbox is required

suffixIconLucideIcon | React.ComponentType<React.SVGProps<SVGSVGElement>> | undefined

Icon to display at the end of the card

valuestring | undefined

Value for form submission

CheckboxCardGroup

PropTypeDefaultDescription
checkedValuesstring[]

Controlled checked values

disabledboolean

Whether the group is disabled

iconLucideIcon | React.ComponentType<React.SVGProps<SVGSVGElement>>

Icon to display instead of the indicator

indicatorSide"end" | "start""start"

Position of the indicator/icon.

namestring

Name for form submission

onCheckedChange(value: string, checked: boolean) => void

Callback when an item changes

requiredboolean

Whether the group is required

showIndicatorbooleantrue

Show the checkbox indicator on each item.

size"base" | "2xs" | "xs" | "sm" | "lg" | "xl" | "2xl" | "3xl""base"

Also exports

  • constcheckboxCardAnatomy
  • componentCheckboxCardContent
  • componentCheckboxCardDescription
  • interfaceCheckboxCardGroupProps
  • componentCheckboxCardIcon
  • interfaceCheckboxCardProps
  • componentCheckboxCardTitle

Anatomy

CheckboxCardGroup

checkbox-card-group

Multi-select group of option cards

CheckboxCard

checkbox-card-item

Selectable card representing a single option

CheckboxCardIcon

checkbox-card-icon

Leading icon or checkbox indicator

CheckboxCardContent

checkbox-card-content

Text stack with title and description

CheckboxCardTitle

checkbox-card-title

Option label

CheckboxCardDescription

checkbox-card-description

Supporting detail for the option

Composition