CheckboxGroup
CheckboxGroup renders a set of Checkboxes.
Page navigation navigation
React examples
Default
With a caption
With a validation message
See the form pattern documentation for more information on form validation patterns.
More code examples
See the CheckboxGroup Storybook stories
Selection required
Props
CheckboxGroup
| Name | Default | Description |
|---|---|---|
aria-labelledby | stringUsed when associating the input group with a label other than CheckboxGroup.Label | |
children Required | CheckboxGroup.Label | CheckboxGroup.Caption | CheckboxGroup.Validation | FormControl | |
disabled | false | booleanWhether the input group allows user input |
id | a generated string | stringThe unique identifier for this input group. Used to associate the label, validation text, and caption text. You may want a custom ID to make it easier to select elements in integration tests. |
onChange | (selected: string[], e?: ChangeEvent<HTMLInputElement>) => voidAn onChange handler that gets called when the selection changes | |
required | false | booleanIf true, the user must make a selection before the owning form can be submitted |
sx Deprecated | SystemStyleObject |
CheckboxGroup.Label
| Name | Default | Description |
|---|---|---|
visuallyHidden | false | booleanIf true, the fieldset legend will be visually hidden |
sx Deprecated | SystemStyleObject |
CheckboxGroup.Caption
| Name | Default | Description |
|---|---|---|
children | React.ReactNodeThe caption content | |
sx Deprecated | SystemStyleObject |
CheckboxGroup.Validation
| Name | Default | Description |
|---|---|---|
children | React.ReactNodeThe validation message | |
variant Required | 'error' | 'success'Changes the visual style to match the validation status | |
sx Deprecated | SystemStyleObject |