Introducing PrimeReact v11-alpha 🎉Discover Now
styledForm

CheckboxGroup

CheckboxGroup groups multiple checkboxes and manages their shared value.

Survey
Which LLM provider should we integrate next?
preview

Usage#

import { Checkbox } from '@primereact/ui/checkbox';
import { CheckboxGroup } from '@primereact/ui/checkboxgroup';
<CheckboxGroup></CheckboxGroup>

Examples#

Basic#

A group of checkboxes sharing a common value array.

basic-demo

Dynamic#

Checkboxes can be generated using a list of values.

dynamic-demo

Card#

Checkboxes can be displayed in a card format.

Select your interests:
card-demo

Indeterminate#

Use indeterminate on a Checkbox.Root (typically a parent/select-all option) to display a partial selection state.

indeterminate-demo

Nested Group#

Use nested groups to manage team-level and permission-level selections in access control flows.

Manage articles, pages, and media
Manage team members and roles
View invoices and manage payments
nested-group-demo

Indicator#

Use Checkbox.Indicator in each group item to render the checked state.

indicator-demo

Checkbox.Indicator also accepts a match prop to render based on the checkbox state.

<Checkbox.Root indeterminate>
    <Checkbox.Box>
        <Checkbox.Indicator match="checked">
            <Check />
        </Checkbox.Indicator>
        <Checkbox.Indicator match="unchecked">
            <Times />
        </Checkbox.Indicator>
        <Checkbox.Indicator match="indeterminate">
            <Minus />
        </Checkbox.Indicator>
    </Checkbox.Box>
</Checkbox.Root>

Available match values: checked, unchecked, indeterminate. Without the match prop, the indicator renders in all states.

Accessibility#

Screen Reader#

Each option in CheckboxGroup is announced as a checkbox by assistive technologies. Associate labels with inputId + <label htmlFor> or provide aria-label / aria-labelledby on each Checkbox.Root.

Keyboard Support#

KeyFunction
tabMoves focus to the next checkbox.
spaceToggles checked or unchecked state.