Skip to content
Protocore Design Systemv1.6.9

/// Inputs

CheckboxGroup

A set of checkboxes sharing one array value — the multi-select counterpart to RadioGroup.

import { CheckboxGroup, CheckboxGroupItem } from "@protocore/pds";
View as Markdown

Basics

Wrap CheckboxGroup.Items in a CheckboxGroup.Root. Each item takes a value and a label; the group owns a string[] and is controllable via value / defaultValue.

Controlled

Drive the selection from state with value + onValueChange. The callback receives the next array on every toggle.

[email]

Horizontal

Set orientation="horizontal" to lay the items in a wrapping row — good for a compact set of filters.

When to use it

Use a CheckboxGroup when any number of options in a small, visible set may be selected at once — permissions, scopes, notification channels. When exactly one option applies, use RadioGroup. When the option list is long or better searched than scanned, use MultiSelect.

Usage

Do

  • Give the group an accessible name via a wrapping `Field` label or `aria-label`.
  • Keep option labels parallel in structure and length.
  • Order options by frequency or logical grouping.

Don't

  • Don't use it for a single on/off — use a standalone Checkbox.
  • Don't use it for one-of-many — use RadioGroup.
  • Don't overflow a dozen options into a group — use MultiSelect.

Accessibility

KeysAction
TabMove focus to the next checkbox in the group.
SpaceToggle the focused checkbox.
  • The container is a `role="group"`; label it with `aria-label` or a wrapping `Field`.
  • Each item is a real checkbox with `aria-checked`; every item is its own Tab stop.
  • A group-level `disabled` disables every item.

CheckboxGroup props

PropTypeDefaultDescription
aria-labelstringAccessible name for the group (or label it via a wrapping Field).
classNamestring
defaultValuestring[]Initial selection when uncontrolled. Default `[]`.
disabledbooleanDisable every item in the group.
namestringShared `name` applied to every item's native input (for form submission).
onValueChange((value: string[]) => void)Fires with the next selection whenever an item toggles.
orientationenumverticalOrientation of the item stack. Default `"vertical"`.
styleCSSProperties
valuestring[]Controlled list of selected values. Pair with `onValueChange`.

CheckboxGroup.Item props

PropTypeDefaultDescription
classNamestringExtra class on the checkbox.
disabledbooleanDisable just this item.
labelReactNodeText rendered beside the box (sans 14).
value *stringThis item's value — added to / removed from the group's array.

Related

  • CheckboxBoxy 16px checkbox with checked, unchecked, and indeterminate states and an optional label.
  • RadioGroupOne-of-many selection with sharp square markers; the active option carries the accent fill.
  • MultiSelectCombobox that holds many values as dismissible Tags, with a checkable, type-to-filter listbox.
  • FieldForm-field wrapper: a caption label, the control, and hint or error messaging with ARIA wired for you.