Live example

Breakfast included where offered
Usage
<Checkbox label="Mark as reviewed" checked={reviewed} onChange={setReviewed} />

Props

Checkbox props
PropTypeDefaultDescription
labelReactNodenoneClickable label.
description?ReactNodenoneHelp text under the label.
indeterminate?booleanfalseMixed state for a parent of partly checked items.
error?stringnoneError tied to the input.
onChange?(checked: boolean) => voidnoneCalled with the new checked state.

Do and don't

Do

  • Use in forms that are submitted.
  • Phrase labels positively: "Send me updates".

Don't

  • Use for settings that apply instantly; use Switch.
  • Use a checkbox for mutually exclusive options.

Accessibility

  • Native input type checkbox, visually replaced but still the focus and click target.
  • Mixed state is set on the DOM property, so screen readers announce "mixed".

Keyboard

Checkbox keyboard support
KeysAction
SpaceToggles the checkbox