Skip to content

CheckboxGroup

A controlled checkbox group for multi-value selection.

Notification channelsChoose any channels that apply.
Best for detailed updates.
<CheckboxGroup
description="Choose any channels that apply."
label="Notification channels"
value={['email', 'push']}
/>
Notification channelsChoose any channels that apply.
Best for detailed updates.
<CheckboxGroup
description="Choose any channels that apply."
label="Notification channels"
value={['email', 'push']}
orientation="horizontal"
/>
TeamsChoose the teams that should receive access.
function WrappingRowStory(args: CheckboxGroupProps): React.JSX.Element {
const [value, setValue] = useState(args.value);
return (
<CheckboxGroup
{...args}
onChange={setValue}
orientation="horizontal"
style={{maxWidth: 420}}
value={value}>
<CheckboxGroupItem label="Design" value="design" />
<CheckboxGroupItem label="Engineering" value="engineering" />
<CheckboxGroupItem label="Marketing" value="marketing" />
<CheckboxGroupItem label="Operations" value="operations" />
<CheckboxGroupItem label="Support" value="support" />
</CheckboxGroup>
);
}
<WrappingRowStory {...args} />
Notification channelsChoose any channels that apply.
Best for detailed updates.
<CheckboxGroup
description="Choose any channels that apply."
label="Notification channels"
value={['email', 'push']}
size="sm"
/>
Notification channelsChoose any channels that apply.
Best for detailed updates.
<CheckboxGroup
description="Choose any channels that apply."
label="Notification channels"
value={['email', 'push']}
size="lg"
/>
Notification channelsChoose any channels that apply.
Best for detailed updates.
<CheckboxGroup
description="Choose any channels that apply."
label="Notification channels"
value={['email', 'push']}
isDisabled
/>
Notification channelsChoose any channels that apply.
function ItemDisabledStory(args: CheckboxGroupProps): React.JSX.Element {
const [value, setValue] = useState(args.value);
return (
<CheckboxGroup {...args} onChange={setValue} value={value}>
<CheckboxGroupItem label="Email" value="email" />
<CheckboxGroupItem isDisabled label="SMS" value="sms" />
<CheckboxGroupItem label="Push" value="push" />
</CheckboxGroup>
);
}
<ItemDisabledStory {...args} />
Notification channelsRequiredChoose any channels that apply.
Best for detailed updates.
<CheckboxGroup
description="Choose any channels that apply."
label="Notification channels"
value={['email', 'push']}
isRequired
/>
Notification channelsOptionalChoose any channels that apply.
Best for detailed updates.
<CheckboxGroup
description="Choose any channels that apply."
label="Notification channels"
value={['email', 'push']}
isOptional
/>
Notification channelsChoose any channels that apply.
Best for detailed updates.
<CheckboxGroup
description="Choose any channels that apply."
label="Notification channels"
value={[]}
status={{ message: 'Select at least one notification channel.', type: 'error', }}
/>
Notification channelsChoose any channels that apply.
Recommended
function WithEndContentStory(args: CheckboxGroupProps): React.JSX.Element {
const [value, setValue] = useState(args.value);
return (
<CheckboxGroup {...args} onChange={setValue} value={value}>
<CheckboxGroupItem
endContent={<Badge color="blue" label="Recommended" />}
label="Email"
value="email"
/>
<CheckboxGroupItem label="SMS" value="sms" />
<CheckboxGroupItem label="Push" value="push" />
</CheckboxGroup>
);
}
<WithEndContentStory {...args} />
Notification channelsChoose any channels that apply.
function WithIconsStory(args: CheckboxGroupProps): React.JSX.Element {
const [value, setValue] = useState(args.value);
return (
<CheckboxGroup {...args} onChange={setValue} value={value}>
<CheckboxGroupItem
label="Email"
startContent={<Icon color="secondary" icon={Mail} size="sm" />}
value="email"
/>
<CheckboxGroupItem
label="SMS"
startContent={<Icon color="secondary" icon={MessageSquare} size="sm" />}
value="sms"
/>
<CheckboxGroupItem
label="Push"
startContent={<Icon color="secondary" icon={Bell} size="sm" />}
value="push"
/>
</CheckboxGroup>
);
}
<WithIconsStory {...args} />
Notification channelsChoose any channels that apply.
Best for detailed updates.
SMS may incur carrier charges.
<CheckboxGroup
description="Choose any channels that apply."
label="Notification channels"
value={['email', 'push']}
status={{message: 'SMS may incur carrier charges.', type: 'warning'}}
/>
Notification channelsChoose any channels that apply.
Best for detailed updates.
Preferences saved.
<CheckboxGroup
description="Choose any channels that apply."
label="Notification channels"
value={['email', 'push']}
status={{message: 'Preferences saved.', type: 'success'}}
/>
Notification channelsChoose any channels that apply.
Best for detailed updates.
<CheckboxGroup
description="Choose any channels that apply."
label="Notification channels"
value={['email', 'push']}
isReadOnly
/>

A controlled checkbox group for multi-value selection.

When isOptional: false, isRequired: false

PropTypeDefaultDescription
children*ReactNode—Checkbox items to render.
classNamestring—Additional CSS class names applied to the field root.
data-testidstring—Test ID applied to the field root.
descriptionReactNode—Supporting text displayed below the label.
htmlNamestring—HTML name attribute shared by checkbox inputs for native form submission.
isDisabledbooleanfalseWhether all checkbox items are disabled.
isReadOnlybooleanfalseWhether all checkbox items are read-only.
isLabelHiddenbooleanfalseWhether to visually hide the label.
label*string—Label text for the checkbox group.
labelEndReactNode—Content shown at the end of the label row, such as a link. It renders outside the label, so it does not focus the control or change its accessible name. It stays visible when isLabelHidden is true.
labelTooltipReactNode—Tooltip content shown next to the label.
onChange*(value: string[]) => void—Callback fired when the selected values change. Memoize with useCallback to avoid unnecessary re-renders of checkbox items.
orientation"horizontal" | "vertical"'vertical'Layout direction of the checkbox items.
refRef<HTMLDivElement>—Ref forwarded to the field root.
size"sm" | "md" | "lg"'md'Size of the checkbox controls.
statusInputStatus—Validation status displayed below the group.
styleCSSProperties—Inline styles applied to the field root.
value*string[]—The currently selected values.
isOptionalfalse—
isRequiredfalse—

When isOptional: true, isRequired: false

PropTypeDefaultDescription
children*ReactNode—Checkbox items to render.
classNamestring—Additional CSS class names applied to the field root.
data-testidstring—Test ID applied to the field root.
descriptionReactNode—Supporting text displayed below the label.
htmlNamestring—HTML name attribute shared by checkbox inputs for native form submission.
isDisabledbooleanfalseWhether all checkbox items are disabled.
isReadOnlybooleanfalseWhether all checkbox items are read-only.
isLabelHiddenbooleanfalseWhether to visually hide the label.
label*string—Label text for the checkbox group.
labelEndReactNode—Content shown at the end of the label row, such as a link. It renders outside the label, so it does not focus the control or change its accessible name. It stays visible when isLabelHidden is true.
labelTooltipReactNode—Tooltip content shown next to the label.
onChange*(value: string[]) => void—Callback fired when the selected values change. Memoize with useCallback to avoid unnecessary re-renders of checkbox items.
orientation"horizontal" | "vertical"'vertical'Layout direction of the checkbox items.
refRef<HTMLDivElement>—Ref forwarded to the field root.
size"sm" | "md" | "lg"'md'Size of the checkbox controls.
statusInputStatus—Validation status displayed below the group.
styleCSSProperties—Inline styles applied to the field root.
value*string[]—The currently selected values.
isOptional*true—
isRequiredfalse—

When isOptional: false, isRequired: true

PropTypeDefaultDescription
children*ReactNode—Checkbox items to render.
classNamestring—Additional CSS class names applied to the field root.
data-testidstring—Test ID applied to the field root.
descriptionReactNode—Supporting text displayed below the label.
htmlNamestring—HTML name attribute shared by checkbox inputs for native form submission.
isDisabledbooleanfalseWhether all checkbox items are disabled.
isReadOnlybooleanfalseWhether all checkbox items are read-only.
isLabelHiddenbooleanfalseWhether to visually hide the label.
label*string—Label text for the checkbox group.
labelEndReactNode—Content shown at the end of the label row, such as a link. It renders outside the label, so it does not focus the control or change its accessible name. It stays visible when isLabelHidden is true.
labelTooltipReactNode—Tooltip content shown next to the label.
onChange*(value: string[]) => void—Callback fired when the selected values change. Memoize with useCallback to avoid unnecessary re-renders of checkbox items.
orientation"horizontal" | "vertical"'vertical'Layout direction of the checkbox items.
refRef<HTMLDivElement>—Ref forwarded to the field root.
size"sm" | "md" | "lg"'md'Size of the checkbox controls.
statusInputStatus—Validation status displayed below the group.
styleCSSProperties—Inline styles applied to the field root.
value*string[]—The currently selected values.
isOptionalfalse—
isRequired*true—

An individual checkbox option within a `CheckboxGroup`.

PropTypeDefaultDescription
aria-labelstring—Accessible name applied to the checkbox input, overriding the label text. Use when a rich label has no useful text. Include any visible label wording.
classNamestring—Additional CSS class names applied to the item root.
data-testidstring—Test ID applied to the input element.
descriptionReactNode—Supporting text displayed below the item label.
endContentReactNode—Content rendered after the label and description.
endContentPositionCheckboxInputProps['endContentPosition']'inline'Where to place endContent within the item.
isDisabledbooleanfalseWhether this checkbox item is disabled.
isReadOnlybooleanfalseWhether this checkbox item is read-only.
label*ReactNode—Label content for the checkbox item. Supports noninteractive formatting, decorative icons, and badges. Keep links and buttons in the content slots. The label's text supplies the accessible name unless aria-label is set.
refRef<HTMLInputElement>—Ref forwarded to the input element.
startContentReactNode—Content rendered after the checkbox control and before the label.
styleCSSProperties—Inline styles applied to the item root.
value*string—Value represented by this checkbox item.