Skip to main content

Checkbox Group

A group of checkboxes for selecting multiple values.

Select options:

Features

Installation

typo3 ui:add checkbox-group

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.

NameDescriptionRequiredDefault
defaultValuearray
The 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
-
namestring
The name of the input fields in the checkbox group. Useful for form submission. Inherited from a surrounding field when available.
No
-
formstring
The form id the checkbox group belongs to.
No
-
disabledboolean
If true, the checkbox group is disabled. Inherited from a surrounding field when available.
No
-
readOnlyboolean
If true, the checkbox group is read-only. Inherited from a surrounding field when available.
No
-
requiredboolean
If true, the checkbox group is required. Inherited from a surrounding field when available.
No
-
invalidboolean
If true, the checkbox group is invalid. Inherited from a surrounding field when available.
No
-
maxSelectedValuesinteger
The 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>