Sakani

Checkbox

A single binary choice, with an optional description and a third indeterminate state.

With a description

Use the description for the consequence of ticking the box, not a restatement of the label.

States

Indeterminate parent

indeterminate is presentational only: the underlying input is still either checked or not, so drive it from whether the children are partly selected.

Props

Every other native input attribute is forwarded to the underlying <input type="checkbox">.

PropTypeDefaultDescription
labelstringText rendered beside the box.
descriptionstringSupporting line under the label.
indeterminatebooleanfalseRenders the dash state, for a parent whose children are partly selected.
checkedbooleanControlled checked state.
defaultCheckedbooleanUncontrolled initial state.
disabledbooleanfalseDisables the input.
onChange(e: ChangeEvent<HTMLInputElement>) => voidFires on toggle.