Skip to content

Navigation Menu

Sign up

Accessibility Checklist

rubyycheung edited this page Aug 28, 2026 · 15 revisions

Accessibility Checklist

The accessibility bar for Astryx components. Every new component — and any change to an interactive one — must clear this checklist before review. Reviewers block on it (see the blocking criteria in .github/copilot-instructions.md), and it is a hard requirement for a lab → core promotion (see packages/lab/README.md).

This page is the canonical, editable home of the checklist so accessibility experts can refine it without a code PR. It is referenced by CONTRIBUTING.md and consumed by the Night Watch Component Auditor.

This page owns what the bar is. Component Audit Rubric owns how each item is verified, how severe a failure is, and how it scores — §1 expands the operability requirements into A1–A21, while rendered contrast is verified by D7. Change the bar here; change how it is checked there.

⚠️ Keep in sync. The checklist items map to shared primitives and CI enforcement in the repo. If you add or reword an item, check whether the corresponding Component Audit Rubric check and the CONTRIBUTING pointer need a matching update.

Use the shared primitives

Compose the shared primitives — VisuallyHidden, useAnnounce, useFocusTrap, and the focus hooks (useListFocus, useGridFocus, useTreeFocus) — rather than hand-rolling equivalents. They implement the WAI-ARIA APG patterns and are tested once; a bespoke reimplementation of one is a review reject.

The checklist

Eleven items. Each has its own section below so a review or an audit can cite it precisely. For a promotion PR, copy all eleven and tick each one in the PR body.

Name

  • Every interactive element has an accessible name, and the widget itself is labeled (visible label, aria-label, or aria-labelledby).

Role

  • The correct ARIA pattern from the WAI-ARIA APG is implemented; link the pattern you implemented in the PR description.

State

  • Every state (selected, expanded, disabled, invalid, busy, ...) is exposed via ARIA, never by color or shape alone.
  • A loading action exposes aria-busy, remains focusable, and blocks duplicate activation through aria-disabled plus guarded pointer and keyboard handlers. It remains actionable only when the API explicitly declares the operation interruptible. Busy editing controls also remain focusable so the user can continue or correct input. Do not use native disabled merely to implement busy state.

Keyboard

  • Full APG keyboard support for the pattern, including RTL arrow-key flipping via the shared focus hooks (they auto-detect direction from the container's computed direction, read lazily on keydown — the isRtl override is deprecated and must not be passed).

Focus

  • Overlays trap focus while open and restore it on close via useFocusTrap; focus is never dropped to <body> on a state change; the focus ring is visible in every theme.

Announcements

  • Async state changes (loading, results, errors) announce via useAnnounce. Never render a live region that is born with content — assistive tech only announces changes to a live region, so it will be silent.

Reduced motion

  • Entry/exit animation goes through useEntryAnimation or is guarded by prefers-reduced-motion.

Contrast and themes

  • Every meaningful rendered foreground/background pair meets WCAG 2.2 AA in every supported color mode and theme under review: 4.5:1 for normal text, 3:1 for large text, and 3:1 for non-text UI and meaningful graphics.
  • Verify every applicable component state — rest, hover, focus-visible, active/pressed, selected/current, loading, read-only, and each status value — including text, placeholders, icons, control boundaries, state indicators, and focus indicators. Do not infer a pass from token names or from one mode; measure the resolved rendered colors and composite alpha colors over their actual backdrop.
  • Record any WCAG exception explicitly. Incidental or decorative content, logotypes, and genuinely inactive controls may be exempt; a low-contrast pair is never accepted merely because it is subtle, secondary, or inherited from a theme.

For a component review, test light and dark plus the non-default theme required by the Component Audit Rubric. For a theme-elevation review, test the theme's full supported component/state matrix: the theme owns every failing pair and cannot inherit the component-audit carve-out for a known systemic token failure. See D7 for the measurement and evidence protocol.

Buttons and composite controls

Use these decisions for Button and for any control that combines text, icons, loading indicators, badges, or other end content:

  • Labels: measure visible normal-size text against the button's actual composited background at rest, hover, and pressed; each pair must be at least 4.5:1 under SC 1.4.3 Contrast (Minimum). Do not round a value up to the threshold. The 3:1 large-text threshold applies only when the rendered label is at least 24 CSS px regular or 18.66 CSS px bold.
  • Icons: an icon-only button, or an icon that uniquely communicates an action or state, is meaningful non-text content and must be at least 3:1 against its background under SC 1.4.11 Non-text Contrast. An icon that merely repeats a visible label is decorative and needs no separate contrast result. Removal is the test: if removing it changes the user's understanding of the action or state, it is meaningful.
  • Boundaries: a button outline or boundary needs 3:1 only when it is required to identify the control. Sufficiently contrasting visible text or a meaningful icon can identify the control without a contrasting outer boundary. This does not remove the separate focus-indicator requirement.
  • Focus: measure the visible focus indicator against each adjacent color at 3:1 under WCAG 2.2 AA non-text contrast. The two-CSS-pixel perimeter-area rule belongs to SC 2.4.13 Focus Appearance at AAA; do not report it as an AA requirement.
  • Loading: measure the spinner's active arc against the button background at 3:1. A faint circular track may be treated as decorative only when removing it leaves the loading state fully understandable; do not require arc-to-track contrast. A loading indicator remains meaningful even when the action is temporarily non-interactive, so do not dim it with the ordinary disabled opacity. Expose and announce the busy state separately under SC 4.1.3 Status Messages.
  • End content: measure visible badge/count text against its fully composited badge surface at 4.5:1. The badge surface does not need 3:1 against the button when the visible text carries the meaning; an unlabeled status dot or color-only mark is meaningful and must pass 3:1 as well as the no-color-alone rule. Arbitrary custom content is evaluated from the final rendered result—the fact that a consumer supplied it is not a WCAG exception.
  • Inactive controls: genuinely disabled controls are exempt from WCAG 1.4.3 and 1.4.11. Apply that exception only to the inactive control treatment, not to a meaningful graphical progress indicator that communicates an operation is still running. Native disabled is an implementation detail, not permission to hide an active status.

Forced colors

  • Painted state (selection fills, custom checkmarks, focus indicators) has system-color fallbacks so it survives forced-colors: active.

i18n

  • Every AT-facing string (labels, announcements, hints) goes through useTranslator() / the i18n key system, same as visible text.

Target size

  • Interactive targets meet WCAG 2.5.8 (AA): a ×ばつ24 CSS-px square fits inside the target — or one of the five exceptions holds. Under 24px is not an automatic fail.
    • Spacing — an undersized target passes if a 24px-diameter circle centered on its bounding box clears every neighboring target and every other undersized target's circle (two ×ばつ20 targets 4px apart pass; touching, they fail; equal targets of side s need 24 − s px of clearance).
    • Inline — the target sits in a sentence or is sized by surrounding line-height (prose links); reflow makes its position unknowable, so it is exempt.
    • Equivalent — the same function is reachable through a ≥24px control on the same page.
    • User-agent — native rendering the author has not resized (native date picker, scrollbars, number spin buttons).
    • Essential — the presentation is required or legally mandated (dense data-viz points, map pins).
  • The rule does not apply to a target while it is obscured by interaction-triggered content (open dropdown, modal, cookie banner); a spatially-selected control (Slider thumb, color-picker gradient, cursor-positioning area) counts as one target. Pointer modality does not raise the AA minimum: coarse pointers follow the same 2.5.8 rule. The ×ばつ44 size in 2.5.5 Target Size (Enhanced) is AAA, not a requirement here.

What CI enforces (and what it can't)

CI is the enforcement layer, not a replacement for the checklist: the pr-a11y workflow runs an axe audit on every PR, a weekly workflow scans the full component surface, and the useAnnounce lint rule rejects hand-wired aria-live regions. axe only catches a subset of static, DOM-level issues — it cannot settle keyboard behavior, focus management, announcement timing, or every contrast pair in its rendered theme/state context. Those are exactly what this checklist, the rubric's manual evidence, and the component's tests cover.

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /