Talisman LogoTalisman Logo Design System
Browse documentation
Components

Checkbox card

A checkbox presented as a selectable card, for options that need a title and a short description.

Stableimport { CheckboxCard } from "@repo/ui/checkbox-card";Source
<CheckboxCard />

The card draws its own indicator. You provide the content as children.

When to use

  • When each option needs a title and a description, such as notification types.
  • When the options are few and the whole card should be easy to hit.
  • In generated forms, where a checkbox field needs a larger target and room for help text.

When not to use

  • A plain option with a short label. Use Checkbox.
  • Choosing exactly one option. Use Radio card.
  • A setting that applies immediately. Use Switch.
  • Long lists. Use Checkbox in a list. Cards take too much space.

States

Selected cards get a solid tertiary background and a tertiary border. The strong outline is reserved for keyboard focus.

Read only

Examples

Group of options

Wrap the cards in an element with role="group" and an accessible name.

Content

  • Start with a title that names the option: “Prazo próximo do vencimento”.
  • Use the description for what happens when it is selected, in one sentence.
  • Build the content with Typography spans. Do not put buttons or links inside the card: the whole card is one control.

Do and don’t

DoCompose a title and a short description with Typography.
Don'tDon't use a card for a bare label. A Checkbox is lighter and easier to scan in a list.

Accessibility

  • Built on Radix Checkbox: the whole card is one button with role="checkbox" and aria-checked set to true, false or "mixed".
  • Space toggles the card. The card has no label element: its text content is the accessible name. Use aria-labelledby and aria-describedby to point at the title and the description.
  • The focus ring appears only for keyboard focus (focus-visible). The indicator icon is hidden from assistive technology (aria-hidden).
  • Selection is shown by a check or a minus inside the box, so it does not rely on color alone.
  • aria-readonly only changes the style: Radix still toggles the card. Ignore the change in onCheckedChange.

Code

import { CheckboxCard } from "@repo/ui/checkbox-card";
import { Typography } from "@repo/ui/typography";

<CheckboxCard checked={checked} onCheckedChange={setChecked}>
  <Typography as="span" variant="labelSm">
    Devolução de contestação
  </Typography>
</CheckboxCard>;

Props

CheckboxCard
PropTypeDefaultDescription
checkedboolean | "indeterminate"—Controlled state: `true`, `false` or `"indeterminate"` (a mixed selection)
childrenReactNode—The card content. Compose a title and a description, and avoid nested interactive controls
disabledbooleanfalseDisables interaction and dims the card
onCheckedChange(checked: boolean | "indeterminate") => void—Called with the new state when the user toggles

Every other prop of the Radix Checkbox root, such as name, value and required, is forwarded. asChild is not available.

Known issues

Issue Effect
Disabled is disabled:opacity-50 on the whole card. A translucent card, against the no-transparency rule. The text contrast can fall below AA.
aria-readonly is styled but not enforced. A read-only card still toggles unless the app ignores the change.
No style for aria-invalid. A card cannot show a validation error.
The focus ring has ring-offset-2 with no offset color token. The offset falls back to Tailwind’s default, white.
Edit this page on GitHub