Checkbox Group
Shared state for a series of checkboxes — one value array in, one out — including a select-all parent with an indeterminate middle state.
tsx
import { Checkbox } from "@/registry/seam/ui/checkbox"
import { CheckboxGroup } from "@/registry/seam/ui/checkbox-group"
import { Label } from "@/registry/seam/ui/label"
export default function CheckboxGroupDemo() {
return (
<CheckboxGroup defaultValue={["replies"]} aria-label="Notifications">
<Label>
<Checkbox name="replies" />
Replies to my threads
</Label>
<Label>
<Checkbox name="mentions" />
Direct mentions
</Label>
<Label>
<Checkbox name="digest" />
Weekly digest
</Label>
</CheckboxGroup>
)
}bunx --bun @seamui/cli@latest add checkbox-groupAPI
| Prop | Type | Default | Description |
|---|---|---|---|
| value / defaultValue | string[] | — | Names of the ticked checkboxes (controlled / uncontrolled). |
| onValueChange | (value, eventDetails) => void | — | Fires with the new name array when any member toggles. |
| allValues | string[] | — | Every member name — required to wire a select-all parent. |
| disabled | boolean | — | Disables the whole group. |
Members are plain seam Checkboxes: give each a name, and mark the select-all one with parent.
Notes
- Motion and haptics live on the member checkboxes — each mark pops with a spring and ticks on commit — so the group wrapper adds no feedback of its own (no double-buzz).
- Inside a
Field, wrap each row inFieldItemfor per-option label wiring; standalone, theLabelwrapper shown in the examples is enough. - The parent checkbox's indeterminate state is managed by Base UI from
allValuesvs the currentvalue.
Press feedback, reduced motion, and haptics follow the global policy — see Motion and Haptics.