Installation
$ pnpm dlx shadcn@latest add @synccn/checkbox-cardsFirst time in this project? Connect synccn with one command.
Usage
import { CheckboxCards } from "@/components/ui/checkbox-cards";<CheckboxCards options={options} />API reference
Generated from the component's TypeScript types, so it always matches the code.
CheckboxCards
Selectable cards for picking several options, each with an icon and description.
PropTypeDescription
- optionsrequired
CheckboxCardOption[]Cards to show.
- value
string[]Controlled selection.
- defaultValue
string[]Default
[]Initial selection when uncontrolled.
- onValueChange
(value: string[]) => voidCalled with the new selection.
- columns
1 | 2 | 3Default
2Columns from the sm breakpoint up.
- className
stringExtra classes for the root element.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
npm packages
- clsx for cn()
- tailwind-merge for cn()
- lucide-react for Check
Accessibility
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA roles: checkbox, group
- ARIA attributes: aria-checked
- Shows a visible focus ring for keyboard users
More inputs
ButtonSeven variants, four sizes and a built-in loading state.InputText field with optional leading icon and invalid state.TextareaMulti-line field that grows with its content and counts characters.CheckboxChecked, unchecked and indeterminate, with label and description.SwitchToggle with a springy thumb in three sizes.Radio GroupPick one option, shown as dots or as selectable cards.