COMPONENTS / MOLECULES / al-checkbox-group← ALL COMPONENTS

Checkbox Group

<al-checkbox-group><ALCheckboxGroup> REACTbetaOPEN IN FIGMA ↗

Reference generated from the custom elements manifest — 10 properties, 3 slots, 1 events.

PLAYGROUND5 CONTROLS
PREVIEW / al-checkbox-group / ALTITUDE
Loading preview
Checkbox 1 Checkbox 2 Checkbox 3 Checkbox 4
direction
FLAGS
CODE — HTML / REACT

Guidance

AUTHORED · CITED TO SOURCE

A set of checkboxes that are one question. It exists for its semantics, not its spacing — it renders a real <fieldset> with a <legend>, carries one field note and one error note for the whole set, and cascades isRequired and isDisabled down to every checkbox inside it.

WHEN TO USE

  • Several checkboxes answer the same question and the user may choose any number of them, including none.
  • The set needs one shared label, one shared helper note, or one shared error — a legend and a field note per group rather than per box.
  • Required or disabled applies to the whole set. Setting it once on the group cascades to the children rather than being repeated on each.

WHEN NOT TO USE

  • The choices are mutually exclusive — exactly one must be selected. That is a different control with different keyboard behaviour.USE RADIO-GROUP →
  • You only want the boxes arranged with spacing between them and there is no shared question, legend or validation. That is arrangement, and it has its own primitive.USE LAYOUT →
  • There is one checkbox. A fieldset around a single control adds a grouping that means nothing.USE CHECKBOX →
  • The user is choosing several values from a long list. A field that opens keeps the form scannable where twenty checkboxes would not.USE SELECT →

DO

  • Give the group a label. It becomes the <legend>, which is what a screen reader reads before each option so the user knows which question they are answering.
  • Set isRequired and isDisabled on the GROUP, not on each checkbox — the group pushes them down to its children on update.
  • Listen for onCheckboxGroupChange, whose detail carries checkedValues — every currently-checked value in the group — alongside the box that changed.
  • Use hideLegend when the surrounding UI already asks the question, rather than dropping label entirely. The legend stays in the accessibility tree.

DON’T

  • Don't add an arrangement prop to this component or wrap it in your own flex container to get a row. Its slot content is already nested in a layout — nest the items in <al-layout direction="row" wrap> instead.
  • Don't use a checkbox group where the answer is binary. One question with a yes and a no is a single checkbox, or a toggle if it takes effect immediately.
  • Don't set the error note without setting the error state, and don't put per-option errors on a group that renders one shared error region.
  • Don't nest a checkbox group inside another. Nested fieldsets are announced as nested groups and quickly become impossible to follow by ear.

ACCESSIBILITY IN PRACTICE

  • The group renders <fieldset> and <legend> — native grouping semantics rather than an ARIA imitation of them. That is the entire reason this component survived the removal of the arrangement-only wrappers.
  • The legend carries aria-describedby pointing at the field note, so the helper text is associated with the question rather than floating beside it.
  • Cascading isRequired to the children means each checkbox reports the requirement itself, which is what assistive technology reads when focus lands on an individual box.

CONTENT GUIDELINES

  • Write the legend as the question the options answer: "Which notifications do you want?", not "Notifications".
  • Say in the field note when the choice is unlimited or bounded — "Choose any that apply", "Choose up to three" — because a checkbox group cannot show a limit on its own.
  • Keep option labels parallel and positive. A list mixing "Enable X" with "Don't send Y" makes the user work out what checking each box means.

WHERE THIS CAME FROM

  • libs/al-web-components/components/checkbox-group/checkbox-group.tsThe native fieldset and legend — the semantics this component exists for.
  • libs/al-web-components/components/checkbox-group/checkbox-group.tsRequired and disabled cascading from the group down to every checkbox in it.
  • libs/al-web-components/components/checkbox-group/checkbox-group.tsThe slot documentation sending row arrangement to `al-layout` rather than to a prop on this component.
  • AGENTS.mdThe table naming exactly why this group is allowed to exist while the arrangement-only wrappers were removed.

Each line above names a file and a literal string that must still appear in it.pnpm gate:guidance re-reads them from this built page, so guidance that has stopped being true fails a check rather than misleading you.

BOTH CHANGEDAltitude Design SystemFIGMA SET · Checkbox Group2 PROPERTY DIFFSFROM TRACKED PROJECTION

Code and Figma each changed since the last confirmed sync. Neither side should be overwritten blindly.

DECIDED BY
CONTRACT DIFF
FIGMA SIDE
OBSERVED
LAST CONFIRMED SYNC
2026-08-28
PUBLIC SURFACE
10 ATTR · 3 SLOT · 1 EVENT · 0 PART

The component’s public surface — attributes and their value sets, slots, events, CSS parts and custom properties, from the manifest — compared against the Figma set’s property definitions.

PROPERTYDISAGREEMENTCODE / CANVAS
theme/space/xs[token-binding] missing-in-code— / theme/space/xs
theme/space/xxs[token-binding] missing-in-canvas--al-theme-space-xxs / —
CHECKEVIDENCEDETAILRESULT
Default stateAXEcheckbox-group--DefaultPASS
Advanced statesAXE6 further storiesPASS
Screen readerMANUALNo screen-reader pass has been recorded for this component.NOT RECORDED
Keyboard navigationINTERACTION TESTSNo interaction tests and no manual keyboard pass.NOT RECORDED

MEASURED 2026-09-08 · 7 STORIES · AXE WCAG2A + WCAG2AA + WCAG21A + WCAG21AA + WCAG22AA

COLOR CONTRAST1 RULE FAILING

The CI gate disables color-contrast globally (libs/al-web-components/story-fixture/src/main.ts), so its result never reaches a test run. It is enabled for this measurement, and reported here whichever way it comes out.

RULEWHEREELEMENTS
color-contrastElements must meet minimum color contrast ratio thresholdscheckbox-group--Disabled1
import '@southleft/al-web-components/components/checkbox-group';
import { ALCheckboxGroup } from '@southleft/al-react';
PROPTYPEDEFAULT
isErrorbooleanError state - Changes the component's treatment to represent an error state
isDisabledbooleanDisabled attribute - Changes the component's treatment to represent a disabled state
isRequiredbooleanRequired attribute - Sets the checkbox to be required for validation
hideLegendbooleanHide legend? - If true, hides the legend from displaying
direction'row' | 'column'Direction - **column** (default) stacks the checkboxes - **row** lays them out inline, wrapping when they run out of room This does NOT re-introduce a hand-rolled arrangement prop. The group already renders an `<al-layout>` around its slotted items; this parameterises THAT layout rather than styling the items here, so `<al-layout>` remains the single arrangement primitive. The row form is a documented variant of the group in the design library (Checkbox Group example, "Horizontal" column), which is why it earns a prop instead of being left to each consumer to compose.
labelstringLabel - Displays inside the legend
errorNotestringError message - An error field note that displays below the checkbox input
fieldNotestringField note - The helper text that displays below the checkbox input
fieldIdstringId attribute - The ID used for A11y and to associate the label with the input
ariaDescribedBystringaria-describedby attribute - Applied to the field note or error note for A11y
SLOTDESCRIPTION
(default)The component content, a set of checkbox items. Items stack in a column by default; for a row, nest them in `<al-layout direction="row" wrap>`.
field-noteIf content is slotted, it will display in place of the fieldNote property
errorIf content is slotted, it will display in place of the errorNote property
EVENTDESCRIPTIONTYPE
onCheckboxGroupChangeFired when any checkbox in the group changes. Detail: `{ checked, value, checkedValues }` — the state and value of the checkbox that changed, plus the values of every currently-checked checkbox in the group.CustomEvent
METHODDESCRIPTION
handleOnCheckboxChange()Handle a change coming from any slotted checkbox 1. Collect the value of every currently-checked checkbox in the group 2. Dispatch the group-level event

SOURCE — components/checkbox-group/checkbox-group.ts · Molecules/Form/Checkbox Group