Component docs

Checkbox

Binary or mixed choice with label, hint and error support.

When to use

  • Use for independent options or a single agreement.
  • Use `indeterminate` for a parent that controls a partially selected group.
  • Keep labels positive (“Email me updates”), not double negatives.

Playground

Change props on the right; the preview and code update instantly.

Props
<Checkbox label="Email me product updates" checked />

Props

PropTypeDefaultDescription
labelReactNode—Clickable label.
hintstring—Helper text linked via aria-describedby.
errorstring—Error message; sets aria-invalid.
indeterminatebooleanfalseMixed state; sets aria-checked="mixed".
checked / defaultCheckedboolean—Controlled / uncontrolled state.
disabledbooleanfalseNative disabled state.
containerClassNamestring—Class for the outer wrapper.

Keyboard navigation

KeysBehavior
Tab / Shift+TabMove focus to / from the box.
SpaceToggle checked.
Clicking the labelToggles the box.

ARIA attributes

AttributeGuidance
aria-checked="mixed"Set automatically for `indeterminate`.
aria-describedbyLinks hint and error text.
aria-invalidSet automatically when `error` is present.
role="group" + aria-labelledbyWrap related checkboxes in a fieldset/legend or labelled group.

Theme tokens

Every part of Checkbox reads from these tokens, so it re-themes in light and dark automatically.

PartTokens
Box
--surface-raised--border-strong--radius-xs--space-5--border-width
Box (checked / mixed)
--primary--primary-foreground--border-width-thick
Box (error)
--destructive
Label & hint
--foreground--muted-foreground--text-sm--weight-medium--text-caption
Focus ring
--focus-ring--focus-ring-width--focus-ring-offset
Hit area & motion
--target-min--duration-fast--ease-standard--opacity-disabled

Accessibility checklist

0 of 5 verified

Focus
Contrast
Target size
Keyboard
Screen reader

Check contrast numbers live on the Accessibility page.