Skip to content

Checkbox

Category: Forms & inputs

<Checkbox>Subscribe to updates</Checkbox>
<Checkbox isIndeterminate>Select all</Checkbox>

Install: @helix-ui/core

import { Checkbox } from '@helix-ui/core';

status: stable · since: 0.1.0

Tags: boolean, toggle, multi-select, form

Open the full editor or source on GitHub.

[ ☐ ] Label ← unchecked
[ ☑ ] Label ← checked
[ ▣ ] Label ← indeterminate
  • display — inline-flex
  • width — content
  • height — content
  • intrinsicSize — ~20px box + label gap
  • stackable — true
  • fullBleed — false

A small rounded square (radius.sm) that fills with brand color when checked, with a white check glyph. Indeterminate state shows a horizontal bar. Label sits to the right with space.2 gap.

Name Type Default Description
isSelected boolean false Controlled checked state.
defaultSelected boolean false Uncontrolled initial state.
isIndeterminate boolean false Shows a dash glyph indicating mixed state.
isRequired boolean false Marks required for validation.
isInvalid boolean false Forces invalid state.
isDisabled boolean false Disables interaction.
onChange (isSelected: boolean) => void — Change handler.
...rest CheckboxProps from react-aria-components — All forwarded.
  • children — visible label text

color.bg.surface.default, color.bg.action.brand.default, color.text.primary, color.text.on.brand, color.border.strong, color.border.focus, color.border.danger, radius.sm, space.2, font.family.sans, font.size.sm

Role: checkbox

Keyboard

Key Action
Space Toggles the checkbox.

Notes

  • Built on react-aria-components Checkbox — full keyboard, screen-reader, and indeterminate handling.
  • For groups of related options, use CheckboxGroup (follow react-aria-components).
Component Relation Note
Field parent Use Field if you need separate label/description structure.
Form parent Submitted as part of a Form.
Switch sibling
RadioGroup sibling

These are the AI prompt → JSX mappings used by the helix-ui prompt DSL and integrations like Cursor / Claude Code.

“checkbox to accept terms”

<Checkbox isSelected={ok} onChange={setOk}>
I agree to the terms
</Checkbox>

“header checkbox with indeterminate when partially selected”

<Checkbox isIndeterminate={partial} isSelected={all} onChange={toggleAll}>
Select all
</Checkbox>