Skip to content

Checkbox

Toggle a boolean value or participate in a multi-select group. Full keyboard and screen-reader support.

  • stable
  • since v0.1.0
  • 2.01 kB
  • form
  • input

role="checkbox" button with aria-checked (mixed for indeterminate); focus ring follows tokens.

Preview
Open
tsx
Preview
Open
tsx

Use checked="indeterminate" (or the shorthand indeterminate prop) for partially-selected states.

Preview
Open
tsx
Preview
Open
tsx

Use CheckboxGroup to manage a set of checkboxes as a multi-select value array.

Preview
Open
tsx
PropTypeDefaultDescription
value
string
Group value — only used when this `<Checkbox>` is a child of `<CheckboxGroup>`. Mutually exclusive with `checked`/`onCheckedChange`.
checked
CheckboxState
Controlled checked state. `"indeterminate"` shows a dash glyph.
defaultChecked
CheckboxState
Uncontrolled initial checked state.
onCheckedChange
((checked: CheckboxState) => void)
Fires with the next checked state on user toggle.
indeterminate
boolean
Forces the visual indeterminate state. Equivalent to `checked="indeterminate"`.
colorScheme
"accent"|"success"|"danger"|"neutral"
"accent"
Colour palette for the checked state.
children
ReactNode
Optional label content — when provided, the checkbox renders inside a `<label>`.
className
string
aria-label
string
aria-labelledby
string
aria-describedby
string
disabled
boolean
Disables interaction and dims the control.
required
boolean
Marks the control as required for form submission.
invalid
boolean
Renders the invalid state and sets `aria-invalid`.
name
string
Submitted form field name.
id
string
Element id — auto-generated when omitted.
autoFocus
boolean
Focuses the control on mount.
size
"sm"|"md"|"lg"
"md"
Control size.
  • Exposes role="checkbox" with proper aria-checked including "mixed" for indeterminate.
  • Focus ring is token-driven; keyboard activation works via Space key natively.
  • disabled blocks both pointer and keyboard interaction.
  • Use CheckboxGroup with name when submitting inside a native <form> — each checked item submits its value.
  • Use indeterminate on a “select all” parent checkbox to reflect partial selection.