Skip to content
synccn

Checkbox Cards

New

Selectable cards with icons for picking several options.

Installation

$ pnpm dlx shadcn@latest add @synccn/checkbox-cards

First 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.

  • optionsrequired
    CheckboxCardOption[]

    Cards to show.

  • value
    string[]

    Controlled selection.

  • defaultValue
    string[]

    Default []

    Initial selection when uncontrolled.

  • onValueChange
    (value: string[]) => void

    Called with the new selection.

  • columns
    1 | 2 | 3

    Default 2

    Columns from the sm breakpoint up.

  • className
    string

    Extra classes for the root element.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Helpers

  • lib/utilscn (merges class names)
  • lib/hooksuseControllable (works controlled or uncontrolled)

npm packages

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