Skip to main content

Rule 13 - Markup: Accessibility

WCAG 2.2 AA requirements for every component.

Rules​

13.1. Every component MUST meet WCAG 2.2 AA.

13.2. All interactive elements MUST be keyboard navigable via Tab. Links MUST be activatable with Enter. Buttons and custom controls MUST be operable via Enter and Space.

13.3. All interactive elements MUST have a visible focus ring via :focus-visible.

13.4. Text MUST meet 4.5:1 color contrast against background. Large text MUST meet 3:1.

13.5. ARIA attributes SHOULD be used only where HTML semantics are insufficient.

13.6. Animations MUST respect prefers-reduced-motion: reduce - see Rule 25.

13.7. Carousels and videos MUST NOT auto-play without user control.

13.8. Implementations MUST prefer native HTML over ARIA. Use <button> not <div role="button">, <details> not <div aria-expanded>, <dialog> not <div role="dialog">.

The drawer keeps role="dialog" on a <div>: it manages its own backdrop, scroll lock and focus trap around an edge-anchored panel that stays in the document flow and opens from button[aria-controls] triggers, and <dialog>'s open / modal model does not map onto that.

13.9. When ARIA is needed, implementations SHOULD use it as a CSS styling hook so accessibility and visual state stay in sync - see Rule 24, Tier 2.

13.10. <label> elements MUST NOT wrap their form control. The label MUST be a sibling associated via for/id. By default the label MUST precede the control so split-field and wrapper enhancements can reposition the label without DOM surgery. This matches the explicit-labeling convention used by major design systems.

<!-- Correct: explicit association, label precedes control -->
<label for="launch-date">Launch date</label>
<input id="launch-date" type="date" />

<!-- Wrong: control wrapped by label -->
<label>
Launch date
<input type="date" />
</label>

Exception - checkbox, radio, switch (sibling order): These three controls render their label AFTER the input, not before. The control is a square/circle/pill glyph; the natural left-to-right reading order places the glyph first and the descriptive text to its right. The label MUST still be a for/id sibling, never a wrapper.

<!-- Correct: input first, label after, explicit for/id -->
<input type="checkbox" id="comms-verified" name="comms-verified" />
<label for="comms-verified">Comms verified</label>

Exception - chip (selectable): The selectable chip variant MUST wrap its checkbox or radio <input> inside the <label> element (the chip switches between the two input types via the is_multiple prop). The chip's visible text is the entire affordance: there is no separate labeled control and no split-field enhancement. Wrapping the input in the label makes the whole chip clickable via native browser behavior without requiring a generated id/for pair, and keeps the markup self-contained. This exception applies only to component: chip; all other form controls continue to follow the sibling-plus-for form above.


Enforced by

13.1-13.10 are review only. See enforcement.md.