Skip to main content
Version: latest
Works everywhere

CheckboxGroup works in both server and client environments. Always use the standard import (e.g. @prokodo/ui/checkbox-group) — the library detects the runtime automatically.

CheckboxGroup

CheckboxGroup manages a set of related Checkbox inputs as a multi-select group. Handles selection state, accessible grouping, and error display for the group as a whole.

Live demo →

Overview

import { CheckboxGroup } from "@prokodo/ui/checkbox-group"
;<CheckboxGroup
label="Interests"
name="interests"
options={[
{ label: "Design", value: "design" },
{ label: "Development", value: "dev" },
{ label: "Marketing", value: "marketing" },
]}
value={selected}
onChange={setSelected}
/>

Import

import { CheckboxGroup } from "@prokodo/ui/checkbox-group"

CSS:

import "@prokodo/ui/checkbox-group.css"

Props

PropTypeDefaultRequiredDescription
legendReactNodeFieldset legend text.
hideLegendbooleanfalseVisually hide the legend (still accessible).
legendPropsobjectProps forwarded to the legend element.
ariaLabelstringAccessible label for the fieldset.
optionsCheckboxGroupOption[]Array of checkbox items.
valuesT[]Controlled selected values.
defaultValuesT[]Uncontrolled initial selected values.
hiddenInputNamestringHidden input name for form submission.
disabledbooleanfalseDisable all checkboxes.
requiredbooleanfalseMark field as required.
layout"stack" | "grid""stack"Layout of the checkbox items.
variant"plain" | "card""plain"Visual variant applied to all checkboxes.
colorVariantsAccent color variant.
onChange(values: T[]) => voidCalled when selection changes.
classNamestringCSS class on root element.

See src/components/checkbox-group/CheckboxGroup.model.ts for the full CheckboxGroupProps type.


Design Tokens

CheckboxGroup inherits the same tokens as Checkbox. See Checkbox — Design Tokens for the full list.

AIC Note

Use the standard import path in application code:

import { CheckboxGroup } from "@prokodo/ui/checkbox-group"

No separate /client or /lazy import selection is required in consumer code.

AIC components also support a priority flag for critical above-the-fold elements. This is most visible on Image (native preloading via <link rel="preload"> for above-the-fold content).


WCAG 2.2 Status

CriterionNameStatusNote
1.3.1Info and Relationships (A)✅ FulfilledSemantic structure (headings, lists, labels, landmarks) must be conveyed programmatically via HTML or ARIA.
1.4.1Use of Color (A)🔍 Manual reviewColor must not be the only means of conveying information (e.g. error states, required field markers).
2.1.1Keyboard (A)✅ FulfilledAll functionality must be operable via keyboard alone, without requiring specific timing.
2.4.7Focus Visible (AA)🔍 Manual reviewA visible keyboard focus indicator must be present on every interactive element. Verify against the applied product theme.
3.3.2Labels or Instructions (A)✅ FulfilledEvery form input requires a programmatically associated label or a visible instruction.
4.1.2Name, Role, Value (A)✅ FulfilledName, role, and state of all interactive UI components must be programmatically determinable via native HTML semantics or ARIA.

Test coverage: 1 jest-axe assertion(s) across 5 test file(s) · 3 ARIA attribute occurrence(s) in source scan. Criteria marked 🔍 require manual verification in the final product integration and theme context.

Storybook

👉 Open CheckboxGroup in Storybook


Source

src/components/checkbox-group/CheckboxGroup.model.ts