# Core/Checkbox - Design

Checkbox component for capturing boolean user input. Supports controlled and uncontrolled modes with proper accessibility.

## Usage

Use a Checkbox when people can turn several options on or off independently within a group, and those choices apply when the form is submitted (or in another explicit save step).

Use a visible group heading and stack options so each label stays associated with its control. Use `indeterminate` on a parent checkbox when a tree or grouped list is partially selected.

## Properties

### Label

A label is required for all checkboxes. They should be short and represent a value or yes/no decision. Ensure
`aria-label` or `aria-labelledby` is used if the checkbox label is not immediately associated with the control.

### Checked

A checkbox can be unchecked, checked, or in an indeterminate state

### Disabled

A checkbox can be disabled in any state if there is a prerequisite to enable the selection.

## Content

* Sentence case labels.
* Describe the option, not the action (e.g., "Send email notifications", not "Enable email").

## Behaviour

### Single choice

A single discrete checkbox can be used for yes/no decisions within a form.

### Overflow

Labels will wrap if they are wider than the parent container. The checkbox remains aligned to the top of the text
box.

## Best Practices

Do:

* Do use checkboxes for multi-select form options.
* Do use `indeterminate` for parent checkboxes in tree structures.
* Do provide a group heading for checkbox groups.

Don't:

* Don't use Checkbox for settings that apply immediately without submit — use Switch.
* Don't use Checkbox for mutually exclusive options — use RadioGroup.
* Don't use a lone Checkbox as a single on/off setting that applies immediately — use Switch.

## Accessibility

* `role="checkbox"`, `aria-checked` (including "mixed" for indeterminate).
* Associate label using `<label for>` or wrapping `<label>`.
* Checkbox group must have a group heading using `role="group"` with `aria-labelledby`.
* Keyboard: Tab / Shift+Tab moves focus; Space or Enter toggles state when the checkbox is focused.

## Related components

* [Switch](?path=/docs/core-switch--design) — For immediate binary settings.
* [RadioGroup](?path=/docs/core-radiogroup--design) — For mutually exclusive selections.