Checkbox

Last updated Feb 13, 2026

Checkbox allows users to select one or more options from a list or toggle a single setting on or off. It supports checked, unchecked, and indeterminate states, making it suitable for grouped or partial selections.

Anatomy of the checkbox component
  1. Container : the square box that indicates selection state.
  2. Label (optional): text describing the option or setting.
  3. Checkmark (optional): the icon that appears inside the box when selected.
  4. Intermediate (optional): the icon that appears inside the box when some children checkboxes are selected.
PropTypeRequiredDefaultDescription
idstring | undefinedfalse-If not provided, a unique ID will be generated.
onChange((e: ChangeEvent<HTMLInputElement>) => void) | undefinedfalse--
labelReactNodefalse--
disabledboolean | undefinedfalse--
indeterminateboolean | undefinedfalse--
checkedboolean | undefinedfalse--
valueunknownfalse--
'data-test'string | undefinedfalse--
containerPropsOmit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> | undefinedfalse--
size"md" | "sm" | undefinedfalse--
tooltipReactNodefalse-Tooltip content to display when hovering over the label. When provided, the label will be wrapped in a tooltip.
  • Letting users select one or more options from a list.
  • Toggling a single preference or setting (e.g., “Remember me”).
  • Representing a list of related options where more than one can apply.
  • Use Radio Buttons when only one option from a group can be selected.
  • Use a Toggle for immediate, binary actions that take effect right away (e.g., turning notifications on or off).
  • Use a single or multi-select Combobox when there are many options and space is limited.

Do

  • Align labels clearly to the checkbox for readability.
  • Use checkboxes consistently within a group.
  • Provide a clear label for every checkbox when possible.

Don't

  • Use checkboxes when only one option is allowed.
  • Hide critical information only in the label; the label should be short and scannable.
  • Rely on checkbox color alone to indicate state.
  • Mix checkbox and other input types within a group (e.g., when selecting pizza toppings, they should all be checkboxes, not a mixture of checkboxes with radio buttons or toggles).
  • Ensure checkboxes are keyboard operable.
  • Provide accessible names through labels; do not rely on placeholder text.
  • Use proper roles (role="checkbox") and states (aria-checked="true/false/mixed") for custom implementations.
  • Support the indeterminate state (aria-checked="mixed") for groups of nested checkboxes.
  • Keep labels short and descriptive.
  • Use sentence case (e.g., “Enable notifications”).
  • Avoid negations (e.g., “Don’t send emails”), instead, phrase positively (“Send me emails”).
  • Make labels meaningful when read alone; they should stand without surrounding context.