CheckboxGroup

CheckboxGroup renders a set of Checkboxes.

Page navigation navigation

React
readyNot reviewed for a11y
Rails
readyNot reviewed for a11y

React examples

Default

Choices

With a caption

ChoicesCaption about the choices

With a validation message

See the form pattern documentation for more information on form validation patterns.

ChoicesSomething went wrong
Something went wrong

More code examples

See the CheckboxGroup Storybook stories

Selection required

Choices
*

Props

CheckboxGroup

NameRequiredDescription
aria-labelledby
string
Used when associating the input group with a label other than CheckboxGroup.Label
children
Required
CheckboxGroup.Label | CheckboxGroup.Caption | CheckboxGroup.Validation | FormControl
disabled
boolean
Whether the input group allows user input
id
string
<span> The unique identifier for this input group. Used to associate the label, validation text, and caption text. <br /> You may want a custom ID to make it easier to select elements in integration tests. </span>
onChange
(selected: string[], e?: ChangeEvent<HTMLInputElement>) => void
An onChange handler that gets called when the selection changes
required
boolean
If true, the user must make a selection before the owning form can be submitted
sx
SystemStyleObject

CheckboxGroup.Label

NameRequiredDescription
visuallyHidden
boolean
If true, the fieldset legend will be visually hidden
sx
SystemStyleObject

CheckboxGroup.Caption

NameRequiredDescription
children
React.ReactNode
The caption content
sx
SystemStyleObject

CheckboxGroup.Validation

NameRequiredDescription
children
React.ReactNode
The validation message
variant
Required
'error' | 'success'
Changes the visual style to match the validation status
sx
SystemStyleObject