Skip to content

Checkbox

The Checkbox is an accessible binary control: checked, unchecked, or (on demand) indeterminate for “select some” patterns. The visible control is a styled box with a check or minus icon; the real state lives on a screen-reader-only native <input type="checkbox">.

Import from the framework package. The label is supplied with title (and optionally subtext). You can run the field uncontrolled (internal state) or controlled with explicit checked state.

Loading Code Block...

A medium-sized checkbox with a single title label, running in uncontrolled mode.

Loading Code Block...
Loading Code Block...

Discrete sizes sm and md adjust the control and typography scale.

Loading Code Block...

title is the primary label. subtext adds supporting copy below the title. titleBold (default true) controls emphasis on the title.

Loading Code Block...

alignment places the box left or right of the label stack.

Loading Code Block...

Use stretch so the label row spans the container with space distributed between the box and text (useful in lists or settings rows). The prop has the same name and semantics in both frameworks.

Loading Code Block...

Disabled checkboxes do not toggle and use muted colours.

Loading Code Block...

The indeterminate visual (minus icon) is for parent rows when some but not all children are selected. It is presentational only: you still manage checked from your data model.

Loading Code Block...

Use textLayout to control how the title and subtext relate to the checkbox. "vertical" (default) stacks the title above the subtext in a column; "horizontal" places the title inline with the checkbox and renders the subtext to the right of the title stack. Both frameworks expose the prop with the same values.

Loading Code Block...
  • The component renders a real input type="checkbox" with sr-only so screen readers get the correct role and state.
  • Associate copy with the control by keeping labels inside the label element (handled by the component).
  • For indeterminate parents, keep aria-checked in sync if you bypass this component’s input; here the visual indeterminate does not set native indeterminate on the DOM input—verify behaviour if you rely on AT for “mixed” state.