Checkbox Group
Checkbox Group lets users select any number of options from a related set.
Purpose
Checkbox Group lets users select any number of options from a related set. Use Radio Group when exactly one option may be selected.
Grouped choices
Installation
With the Siteplane registry alias configured, add the component and import the installed source from your app.
CLI
pnpm dlx shadcn@4.16.1 add @siteplane/checkbox-groupImport
import { Checkbox } from "@/components/ui/checkbox";
import { CheckboxGroup } from "@/components/ui/checkbox-group";Need the machine-readable source metadata? View registry JSON.
Usage
Use Checkbox Group to keep related multi-select choices together while each Checkbox owns its checked state.
import { Checkbox } from "@/components/ui/checkbox";
import { CheckboxGroup } from "@/components/ui/checkbox-group";
import { Label } from "@/components/ui/label";
export function Example() {
return (
<CheckboxGroup aria-label="Notification channels" defaultValue={["email"]}>
<Label><Checkbox value="email" />Email</Label>
<Label><Checkbox value="sms" />SMS</Label>
</CheckboxGroup>
);
}Examples
States, field wiring, select-all, layout overrides, form integration, group sizes and option descriptions are compositions of the same CheckboxGroup and Checkbox primitives.
States
Field with error
Select all with indeterminate parent
Horizontal group
Card style options
Form integration
Sizes
With descriptions
API Reference
The reference lists the source-owned exports and props that are easy to miss in visual examples. Inherited Base UI props remain available unless the wrapper narrows them.
- Give each child
Checkboxa stablevalue; groupvalue,defaultValue, andonValueChangeuse arrays. allValuesenables the first-class select-all contract. Combine it with<Checkbox parent />to derive checked and indeterminate state and toggle all children without manual synchronization.- Use
sizeon the group to size its children, with a local Checkbox size taking precedence.
Motion
Component motion uses the shared Siteplane motion contract. See the global motion guide for provider setup, tokens and reduced-motion behavior.
- Check, indeterminate, border, focus, and reduced-motion behavior comes from Checkbox.
- Selection must not change row or card dimensions.
Accessibility
- Name every group through visible context,
aria-label, oraria-labelledby. - Pair every Checkbox with visible clickable label text or an accessible label.
- Put invalid state on the group and render a visible
FieldError. - The parent Checkbox must communicate mixed state when only some children are selected.
Implementation Guidance
- Always group related multi-select options in Checkbox Group.
- Use
allValuesandCheckbox parentfor select-all behavior instead of rebuilding synchronization with local state. - Use
Fieldfor group labels, descriptions, and validation.