Use Checkbox Group...
- When multiple related options from a group can be selected.
Don't use Checkbox Group...
- When the user must choose exactly one option from a group. Use Radio Group instead.
- For selectable buttons, cards, tiles, or color swatches. Use Choice Group instead.
- For a standalone option. Use Checkbox instead.
The preview has been updated.
Disabled
Use disabled on any Checkboxes within Checkbox Group to prevent them from being selected or deselected.
To disable the entire group, use disabled on each item.
The preview has been updated.
Labels, errors, and helper text
Use the FormField components to add a label, error message, or helper text to a Checkbox Group. They apply the necessary ARIA attributes for you, so you don't need to add them yourself.
Managing State
Controlled
Use selection and onSelectionChange on Checkbox Group to control the selected values. selection is an array of the values of the currently selected Checkbox components, or an empty array ([]) if nothing is selected. onSelectionChange receives the updated array and the native change event. Update your state in the handler so the group reflects the new selection.
The preview has been updated.
Uncontrolled
Omit selectedValues to allow the browser to manage the state. Optionally, use defaultSelectedValues to set the initially selected values, and/or pass onSelectedValuesChange to react to changes (for example, to track the selection) without taking over the state.
The preview has been updated.
Accessibility
Both Checkbox Group and Checkbox must have a localized accessible name.
Checkbox Group
Use a FormLabel to provide a visible and accessible name (recommended, see Labels, helpers, and error text). Alternatively, use custom ARIA labels (see Accessibility guidelines).
Checkbox
Refer to the Checkbox usage guidelines.