Skip to content

Checkbox Group

Shared multiple-selection state for the checkboxes it renders.

Allowed file types

Uploads of other types are rejected.

hero.tsx

Usage guidelines

  • Use CheckboxGroup for several values from a visible set. Use Combobox when the set is long enough to need search, RadioGroup when only one value applies, and a single Checkbox for one boolean value.
  • Compose it as a form field: Field holds the name, Fieldset render={<CheckboxGroup />} provides group semantics, FieldsetLegend names the group, and each option sits in a FieldItem with its own FieldLabel.
  • Pass value, defaultValue, onValueChange and disabled to CheckboxGroup, not to Fieldset. Each Checkbox only states which value it stands for.
  • The group holds the selection of the checkboxes it renders. Selection beyond them, such as other pages or filtered-out rows, stays in the owner's domain state, which hands the group only the part it can show.
  • The value is a string[]. Map stronger domain IDs at the boundary that owns them.

Anatomy

tsx
tsx

Examples

Parent checkbox

Add a Checkbox with parent and pass every child value to allValues on a controlled group. The parent shows the mixed state when only some children are selected. From a partial selection, it cycles through all, none, and back to that selection.

Agent tools
parent.tsx

Selection across pages

The owner keeps the selection for every page. The group receives the current page's share as value and its values as allValues, and onValueChange merges the page's new selection back. Key the group by page so the parent checkbox does not restore a partial selection from another page.

Documents to re-index
2 of 9 selected
paged-selection.tsx

Keyboard

KeyAction
TabMoves focus to the next checkbox in the group.
SpaceToggles the focused checkbox. On the parent, cycles through all, none, and the previous partial selection.

API reference

CheckboxGroup

Provides shared state to a series of checkboxes, including allValues and parent checkbox coordination. Renders a <div> element.

Base UI CheckboxGroup docs

Data attributes
AttributeDescription
data-disabled

Present when the checkbox group is disabled.