CheckboxGroup
A controlled checkbox group for multi-value selection.
Examples
Section titled “Examples”Default
Section titled “Default”Notification channelsChoose any channels that apply.
Best for detailed updates.
<CheckboxGroup description="Choose any channels that apply." label="Notification channels" value={['email', 'push']}/>Horizontal
Section titled “Horizontal”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"/>Wrapping Row
Section titled “Wrapping Row”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"/>Disabled
Section titled “Disabled”Notification channelsChoose any channels that apply.
Best for detailed updates.
<CheckboxGroup description="Choose any channels that apply." label="Notification channels" value={['email', 'push']} isDisabled/>Item Disabled
Section titled “Item Disabled”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} />Required
Section titled “Required”Notification channelsRequiredChoose any channels that apply.
Best for detailed updates.
<CheckboxGroup description="Choose any channels that apply." label="Notification channels" value={['email', 'push']} isRequired/>Optional
Section titled “Optional”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.
Select at least one notification channel.
<CheckboxGroup description="Choose any channels that apply." label="Notification channels" value={[]} status={{ message: 'Select at least one notification channel.', type: 'error', }}/>With End Content
Section titled “With End Content”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} />With Icons
Section titled “With Icons”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} />Warning
Section titled “Warning”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'}}/>Success
Section titled “Success”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'}}/>Read Only
Section titled “Read Only”Notification channelsChoose any channels that apply.
Best for detailed updates.
<CheckboxGroup description="Choose any channels that apply." label="Notification channels" value={['email', 'push']} isReadOnly/>CheckboxGroup
Section titled “CheckboxGroup”A controlled checkbox group for multi-value selection.
When isOptional: false, isRequired: false
| Prop | Type | Default | Description |
|---|---|---|---|
children* | ReactNode | — | Checkbox items to render. |
className | string | — | Additional CSS class names applied to the field root. |
data-testid | string | — | Test ID applied to the field root. |
description | ReactNode | — | Supporting text displayed below the label. |
htmlName | string | — | HTML name attribute shared by checkbox inputs for native form submission. |
isDisabled | boolean | false | Whether all checkbox items are disabled. |
isReadOnly | boolean | false | Whether all checkbox items are read-only. |
isLabelHidden | boolean | false | Whether to visually hide the label. |
label* | string | — | Label text for the checkbox group. |
labelTooltip | ReactNode | — | 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. |
ref | Ref<HTMLDivElement> | — | Ref forwarded to the field root. |
size | "sm" | "md" | "lg" | 'md' | Size of the checkbox controls. |
status | InputStatus | — | Validation status displayed below the group. |
style | CSSProperties | — | Inline styles applied to the field root. |
value* | string[] | — | The currently selected values. |
isOptional | false | — | |
isRequired | false | — |
When isOptional: true, isRequired: false
| Prop | Type | Default | Description |
|---|---|---|---|
children* | ReactNode | — | Checkbox items to render. |
className | string | — | Additional CSS class names applied to the field root. |
data-testid | string | — | Test ID applied to the field root. |
description | ReactNode | — | Supporting text displayed below the label. |
htmlName | string | — | HTML name attribute shared by checkbox inputs for native form submission. |
isDisabled | boolean | false | Whether all checkbox items are disabled. |
isReadOnly | boolean | false | Whether all checkbox items are read-only. |
isLabelHidden | boolean | false | Whether to visually hide the label. |
label* | string | — | Label text for the checkbox group. |
labelTooltip | ReactNode | — | 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. |
ref | Ref<HTMLDivElement> | — | Ref forwarded to the field root. |
size | "sm" | "md" | "lg" | 'md' | Size of the checkbox controls. |
status | InputStatus | — | Validation status displayed below the group. |
style | CSSProperties | — | Inline styles applied to the field root. |
value* | string[] | — | The currently selected values. |
isOptional* | true | — | |
isRequired | false | — |
When isOptional: false, isRequired: true
| Prop | Type | Default | Description |
|---|---|---|---|
children* | ReactNode | — | Checkbox items to render. |
className | string | — | Additional CSS class names applied to the field root. |
data-testid | string | — | Test ID applied to the field root. |
description | ReactNode | — | Supporting text displayed below the label. |
htmlName | string | — | HTML name attribute shared by checkbox inputs for native form submission. |
isDisabled | boolean | false | Whether all checkbox items are disabled. |
isReadOnly | boolean | false | Whether all checkbox items are read-only. |
isLabelHidden | boolean | false | Whether to visually hide the label. |
label* | string | — | Label text for the checkbox group. |
labelTooltip | ReactNode | — | 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. |
ref | Ref<HTMLDivElement> | — | Ref forwarded to the field root. |
size | "sm" | "md" | "lg" | 'md' | Size of the checkbox controls. |
status | InputStatus | — | Validation status displayed below the group. |
style | CSSProperties | — | Inline styles applied to the field root. |
value* | string[] | — | The currently selected values. |
isOptional | false | — | |
isRequired* | true | — |
CheckboxGroupItem
Section titled “CheckboxGroupItem”An individual checkbox option within a `CheckboxGroup`.
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional CSS class names applied to the item root. |
data-testid | string | — | Test ID applied to the input element. |
description | ReactNode | — | Supporting text displayed below the item label. |
endContent | ReactNode | — | Content rendered after the label and description. |
endContentPosition | CheckboxInputProps['endContentPosition'] | 'inline' | Where to place endContent within the item. |
isDisabled | boolean | false | Whether this checkbox item is disabled. |
isReadOnly | boolean | false | Whether this checkbox item is read-only. |
label* | string | — | Label text for the checkbox item. |
ref | Ref<HTMLInputElement> | — | Ref forwarded to the input element. |
startContent | ReactNode | — | Content rendered after the checkbox control and before the label. |
style | CSSProperties | — | Inline styles applied to the item root. |
value* | string | — | Value represented by this checkbox item. |