Skip to content

Checkbox

Checkbox

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

Install: @helixui/core

import { Checkbox } from '@helixui/core'

status: stable · since: 0.1.0

Tags: boolean, toggle, multi-select, form

Live playground

Open the full editor or source on GitHub.

Anatomy

[ ☐ ] Label ← unchecked
[ ☑ ] Label ← checked
[ ▣ ] Label ← indeterminate

Layout

  • displayinline-flex
  • widthcontent
  • heightcontent
  • intrinsicSize~20px box + label gap
  • stackabletrue
  • fullBleedfalse

Visual

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.

Props

NameTypeDefaultDescription
isSelectedbooleanfalseControlled checked state.
defaultSelectedbooleanfalseUncontrolled initial state.
isIndeterminatebooleanfalseShows a dash glyph indicating mixed state.
isRequiredbooleanfalseMarks required for validation.
isInvalidbooleanfalseForces invalid state.
isDisabledbooleanfalseDisables interaction.
onChange(isSelected: boolean) => voidChange handler.
...restCheckboxProps from react-aria-componentsAll forwarded.

Slots

  • children — visible label text

Tokens used

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

Accessibility

Role: checkbox

Keyboard

KeyAction
SpaceToggles 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).

Composes with

ComponentRelationNote
FieldparentUse Field if you need separate label/description structure.
FormparentSubmitted as part of a Form.
Switchsibling
RadioGroupsibling

Prompt examples

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

agree-to-terms

“checkbox to accept terms”

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

select all in a table

“header checkbox with indeterminate when partially selected”

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