Checkbox

Checkboxes let people select one or more items from a list, or turn an item on or off.

Usage

Checkbox selects one or more independent options. Associate every instance with a visible <label> using id / htmlFor in React, id / for in Angular, or id / for in Svelte.

Checked and disabled states

Use checked with onCheckedChange in React, or [(checked)] in Angular. defaultChecked captures the initial uncontrolled state. A controlled checkbox emits a request but does not change until its owner supplies the new value. Use disabled to prevent interaction and form changes.

Mixed selection

Use indeterminate for a parent option when its child selection is mixed. It does not change the underlying checked value. Keep the parent checked value derived from its children.

Form validation

Set name and value when the checkbox participates in form submission. Use required for a mandatory choice. Expose the error state with invalid and connect its explanation with aria-describedby.

Required to continue.

Accessibility

Checkbox renders a native checkbox, so Space toggles it and assistive technologies receive checked, mixed, disabled, and invalid states directly. The 40px touch target exposes a visible focus outline. This component never creates a label or an error message on its own.