Browse the docs
Inputs / Checkbox

Checkbox

The tick is drawn in one stroke and overshoots the box, like a pen would.

Client componentWCAG AASince v0.1
Notify on dispatch

Change every prop live in the playground.

Props

PropTypeDefaultWhat it does
childrenReactNodenoneThe label.
indeterminatebooleanfalseShows a dash: some, but not all, of a group is checked.
onChange(event: ChangeEvent<HTMLInputElement, Element>) => voidnone—
onCheckedChange(checked: boolean) => voidnone—
tickColorstringinkColor of the tick, as a CSS color or token variable.

Also takes every attribute of <input> (305 more, e.g. onClick, className, aria-*).

Use it well

DoGroup related checkboxes in a fieldset with a legend.
Don'tUse a single checkbox for an on/off setting that applies immediately. That's a Switch.

Accessibility

  • A real <input type="checkbox">: forms, keyboard and screen readers just work.
  • indeterminate sets the input's own state and aria-checked="mixed".
  • Focus draws a dashed outline around the box.
Five stamps!

All aboard.

You took the whole tour. Here's Holo Pip, a foil sticker for riders who finish. It's in your playground tray now, for good.