Checkbox Group
A group of checkboxes for selecting multiple values.
Select options:
Features
- Multiple selection support (unlike RadioGroup which is single selection)
- Optional maximum number of selections via
maxSelectedValues - Full keyboard navigation support
- Syncs with native form elements for proper form submission
- Works with Field component for form integration
Installation
typo3 ui:add checkbox-group
Please copy the files manually from GitHub into your project.
Read more about installing Components and Primitives.
Examples
Default Checked
Pre-select multiple options using an array of values.
Notification preferences:
Disabled Items
Disable specific checkbox options.
Select plans:
Disabled Group
Disable the entire checkbox group.
Select features:
Maximum Selections
Limit the number of selectable options. Once the limit is reached, remaining unchecked options are automatically disabled.
Pick up to 2 colors:
Select All
Implement a "Select All" checkbox that toggles all options.
API Reference
The following tables cover the available props of the Fluid Primitives.
checkboxGroup.root
Provides shared state for a group of related checkboxes. Renders a <div> element.
| Name | Description | Required | Default |
|---|---|---|---|
defaultValue | arrayThe initial value of the checkbox group. Use when you don't need to control the value of the checkbox group. Inherited from a surrounding field when available. | No | - |
name | stringThe name of the input fields in the checkbox group. Useful for form submission. Inherited from a surrounding field when available. | No | - |
form | stringThe form id the checkbox group belongs to. | No | - |
disabled | booleanIf true, the checkbox group is disabled. Inherited from a surrounding field when available. | No | - |
readOnly | booleanIf true, the checkbox group is read-only. Inherited from a surrounding field when available. | No | - |
required | booleanIf true, the checkbox group is required. Inherited from a surrounding field when available. | No | - |
invalid | booleanIf true, the checkbox group is invalid. Inherited from a surrounding field when available. | No | - |
maxSelectedValues | integerThe maximum number of selected values. | No | - |
checkboxGroup.label
Labels the checkbox group. Renders a <span> element.
Anatomy
<primitives:checkboxGroup.root>
<primitives:checkboxGroup.label />
<primitives:checkbox.root>
<primitives:checkbox.control>
<primitives:checkbox.indicator />
</primitives:checkbox.control>
<primitives:checkbox.label />
<primitives:checkbox.hiddenInput />
</primitives:checkbox.root>
</primitives:checkboxGroup.root>