Accessibility
Comprehensive patterns for building accessible web applications: WCAG 2.2 AA compliance, keyboard focus management, React Aria component patterns, native HTML-first philosophy, cognitive inclusion, and user preference honoring. Each category has individual rule files in rules/ loaded on-demand.
Quick Reference
| Category |
Rules |
Impact |
When to Use |
| WCAG Compliance |
3 |
CRITICAL |
Color contrast, semantic HTML, automated testing |
| POUR Exit Criteria |
1 |
CRITICAL |
Falsifiable pass/fail thresholds for each WCAG 2.2 AA criterion |
| Static Anti-Patterns |
1 |
HIGH |
Grep-able patterns detectable without a browser |
| Focus Management |
1 |
HIGH |
Keyboard navigation; trap/restoration mechanics live upstream |
| React Aria |
2 |
HIGH |
Accessible components and form hooks; overlay APIs live upstream |
| Modern Web Accessibility |
2 |
CRITICAL/HIGH |
Native HTML first, user preferences; cognitive ceilings in references/ork-delta.md |
Total: 10 rules across 6 categories
Quick Start
// Semantic HTML with ARIA
<main>
<article>
<header><h1>Page Title</h1></header>
<section aria-labelledby="features-heading">
<h2 id="features-heading">Features</h2>
</section>
</article>
</main>
// Focus trap with React Aria
import { FocusScope } from 'react-aria';
<FocusScope contain restoreFocus autoFocus>
<div role="dialog" aria-modal="true">
{children}
</div>
</FocusScope>
WCAG Compliance
WCAG 2.2 AA implementation for inclusive, legally compliant web applications.
| Rule |
File |
Key Pattern |
| Color Contrast |
rules/wcag-color-contrast.md |
4.5:1 text, 3:1 UI components, focus indicators |
| Semantic HTML |
rules/wcag-semantic-html.md |
Landmarks, headings, ARIA labels, form structure |
| Testing |
rules/wcag-testing.md |
axe-core, Playwright a11y, screen reader testing |
POUR Exit Criteria
Concrete pass/fail thresholds for each WCAG 2.2 AA criterion — replaces vague "meets requirements" checks.
| Rule |
File |
Key Pattern |
| POUR Exit Criteria |
rules/pour-exit-criteria.md |
Falsifiable checklist: image alt, contrast ratios, focus indicators, touch targets, ARIA states |
Static Anti-Patterns
Grep-able anti-patterns detectable via static analysis or code review — no browser needed.
| Rule |
File |
Key Pattern |
| A11y Anti-Patterns (Static) |
rules/a11y-antipatterns-static.md |
Focus removal, missing labels, autoplay, icon-only buttons, div-click handlers |
Focus Management
Keyboard focus management patterns for accessible interactive widgets.
| Rule |
File |
Key Pattern |
| Keyboard Navigation |
rules/focus-keyboard-nav.md |
Roving tabindex, skip links, arrow keys |
Focus trap and restoration mechanics are upstream's job: use React Aria <FocusScope contain restoreFocus autoFocus> (see Upstream coverage). When React Aria is unavailable, copy scripts/focus-trap-template.tsx; the house rules for both live in references/ork-delta.md.
React Aria
Adobe React Aria hooks for building WCAG-compliant interactive UI.
| Rule |
File |
Key Pattern |
| Components |
rules/aria-components.md |
useButton, useDialog, useMenu, FocusScope |
| Forms |
rules/aria-forms.md |
useComboBox, useTextField, useListBox |
Overlay hook APIs (useModalOverlay, useTooltip, usePopover) are documented upstream (see Upstream coverage); the house overlay recipe (FocusScope plus shared motion presets) is in references/ork-delta.md.
Modern Web Accessibility
2026 best practices: native HTML first, cognitive inclusion, and honoring user preferences.
| Rule |
File |
Key Pattern |
| Native HTML First |
rules/wcag-native-html-first.md |
<dialog>, <details>, native over custom ARIA |
| User Preferences |
rules/wcag-user-preferences.md |
prefers-reduced-motion, forced-colors, prefers-contrast, zoom |
Cognitive inclusion (ADHD/autism/dyslexia support) is covered upstream by W3C COGA (see Upstream coverage); the house cognitive-load ceilings (notification cap, nav-item cap, reading-level targets) are in references/ork-delta.md.
Key Decisions
| Decision |
Recommendation |
| Conformance level |
WCAG 2.2 AA (legal standard: ADA, Section 508) |
| Contrast ratio |
4.5:1 normal text, 3:1 large text and UI components |
| Target size |
24px min (WCAG 2.5.8), 44px for touch |
| Focus indicator |
3px solid outline, 3:1 contrast |
| Component library |
React Aria hooks for control, react-aria-components for speed |
| State management |
react-stately hooks (designed for a11y) |
| Focus management |
FocusScope for modals, roving tabindex for widgets |
| Testing |
jest-axe (unit) + Playwright axe-core (E2E) |
Anti-Patterns (FORBIDDEN)
- Div soup: Using
<div> instead of semantic elements (<nav>, <main>, <article>)
- Color-only information: Status indicated only by color without icon/text
- Missing labels: Form inputs without associated
<label> or aria-label
- Keyboard traps: Focus that cannot escape without Escape key
- Removing focus outline:
outline: none without replacement indicator
- Positive tabindex: Using
tabindex > 0 (disrupts natural order)
- Div with onClick: Using
<div onClick> instead of <button> or useButton
- Manual focus in modals: Using
useEffect + ref.focus() instead of FocusScope
- Auto-playing media: Audio/video that plays without user action
- ARIA overuse: Using ARIA when semantic HTML suffices
Upstream coverage (do not restate)
Vendor tutorials, API references, and criterion walkthroughs removed in the 2026-07-31 wrap-plus-delta thinning. Consult the first-party source; only the ork delta (floors, scars, house decisions) lives in references/ork-delta.md.
| Topic |
First-party source |
| WCAG 2.2 success-criterion walkthroughs and audit checklists |
WCAG 2.2 quick reference and WCAG 2.2 spec |
| ARIA widget patterns and keyboard interaction models |
WAI-ARIA Authoring Practices Guide |
| React Aria hook APIs (useButton, useMenu, useComboBox, useModalOverlay, useTooltip, usePopover), component checklists, worked examples |
React Aria docs |
| Focus trap, focus restoration, roving tabindex, and skip-link algorithms |
React Aria FocusScope and APG patterns |
| Cognitive accessibility guidance (COGA) |
W3C Making Content Usable |
| Screen reader testing walkthroughs (NVDA, JAWS, VoiceOver, TalkBack) |
WebAIM screen reader testing |
Detailed Documentation
| Resource |
Description |
scripts/ |
Templates: accessible form, focus trap, React Aria components |
references/ork-delta.md |
Ork-specific floors, scars, and house decisions (cognitive ceilings, overlay recipe, canonical focus-trap selector) |
references/ux-thresholds-quick.md |
UI/UX thresholds quick reference: contrast, touch targets, cognitive load, typography, forms |
examples/wcag-examples.md |
Complete accessible form, modal, and navigation examples |
Related Skills
ork:testing-e2e - E2E testing patterns including accessibility testing
design-system-starter - Accessible component library patterns
ork:i18n-date-patterns - RTL layout and locale-aware formatting
motion-animation-patterns - Reduced motion and animation accessibility
1---2name: accessibility3description: Accessibility patterns for WCAG 2.2 compliance, keyboard focus management, React Aria component patterns, cognitive inclusion, native HTML-first philosophy, and user preference honoring. Use when implementing screen reader support, keyboard navigation, ARIA patterns, focus traps, accessible component libraries, reduced motion, or cognitive accessibility.4license: MIT5---6
7# Accessibility
8
9Comprehensive patterns for building accessible web applications: WCAG 2.2 AA compliance, keyboard focus management, React Aria component patterns, native HTML-first philosophy, cognitive inclusion, and user preference honoring. Each category has individual rule files in `rules/` loaded on-demand.
10
11## Quick Reference
12
13| Category | Rules | Impact | When to Use |
14|----------|-------|--------|-------------|
15| [WCAG Compliance](#wcag-compliance) | 3 | CRITICAL | Color contrast, semantic HTML, automated testing |
16| [POUR Exit Criteria](#pour-exit-criteria) | 1 | CRITICAL | Falsifiable pass/fail thresholds for each WCAG 2.2 AA criterion |
17| [Static Anti-Patterns](#static-anti-patterns) | 1 | HIGH | Grep-able patterns detectable without a browser |
18| [Focus Management](#focus-management) | 1 | HIGH | Keyboard navigation; trap/restoration mechanics live upstream |
19| [React Aria](#react-aria) | 2 | HIGH | Accessible components and form hooks; overlay APIs live upstream |
20| [Modern Web Accessibility](#modern-web-accessibility) | 2 | CRITICAL/HIGH | Native HTML first, user preferences; cognitive ceilings in `references/ork-delta.md` |
21
22**Total: 10 rules across 6 categories**
23
24## Quick Start
25
26```tsx
27// Semantic HTML with ARIA
28<main>
29 <article>
30 <header><h1>Page Title</h1></header>
31 <section aria-labelledby="features-heading">
32 <h2 id="features-heading">Features</h2>
33 </section>
34 </article>
35</main>
36```
37
38```tsx
39// Focus trap with React Aria
40import { FocusScope } from 'react-aria';
41
42<FocusScope contain restoreFocus autoFocus>
43 <div role="dialog" aria-modal="true">
44 {children}
45 </div>
46</FocusScope>
47```
48
49## WCAG Compliance
50
51WCAG 2.2 AA implementation for inclusive, legally compliant web applications.
52
53| Rule | File | Key Pattern |
54|------|------|-------------|
55| Color Contrast | `rules/wcag-color-contrast.md` | 4.5:1 text, 3:1 UI components, focus indicators |
56| Semantic HTML | `rules/wcag-semantic-html.md` | Landmarks, headings, ARIA labels, form structure |
57| Testing | `rules/wcag-testing.md` | axe-core, Playwright a11y, screen reader testing |
58
59## POUR Exit Criteria
60
61Concrete pass/fail thresholds for each WCAG 2.2 AA criterion — replaces vague "meets requirements" checks.
62
63| Rule | File | Key Pattern |
64|------|------|-------------|
65| POUR Exit Criteria | `rules/pour-exit-criteria.md` | Falsifiable checklist: image alt, contrast ratios, focus indicators, touch targets, ARIA states |
66
67## Static Anti-Patterns
68
69Grep-able anti-patterns detectable via static analysis or code review — no browser needed.
70
71| Rule | File | Key Pattern |
72|------|------|-------------|
73| A11y Anti-Patterns (Static) | `rules/a11y-antipatterns-static.md` | Focus removal, missing labels, autoplay, icon-only buttons, div-click handlers |
74
75## Focus Management
76
77Keyboard focus management patterns for accessible interactive widgets.
78
79| Rule | File | Key Pattern |
80|------|------|-------------|
81| Keyboard Navigation | `rules/focus-keyboard-nav.md` | Roving tabindex, skip links, arrow keys |
82
83Focus trap and restoration mechanics are upstream's job: use React Aria `<FocusScope contain restoreFocus autoFocus>` (see [Upstream coverage](#upstream-coverage-do-not-restate)). When React Aria is unavailable, copy `scripts/focus-trap-template.tsx`; the house rules for both live in `references/ork-delta.md`.
84
85## React Aria
86
87Adobe React Aria hooks for building WCAG-compliant interactive UI.
88
89| Rule | File | Key Pattern |
90|------|------|-------------|
91| Components | `rules/aria-components.md` | useButton, useDialog, useMenu, FocusScope |
92| Forms | `rules/aria-forms.md` | useComboBox, useTextField, useListBox |
93
94Overlay hook APIs (useModalOverlay, useTooltip, usePopover) are documented upstream (see [Upstream coverage](#upstream-coverage-do-not-restate)); the house overlay recipe (FocusScope plus shared motion presets) is in `references/ork-delta.md`.
95
96## Modern Web Accessibility
97
982026 best practices: native HTML first, cognitive inclusion, and honoring user preferences.
99
100| Rule | File | Key Pattern |
101|------|------|-------------|
102| Native HTML First | `rules/wcag-native-html-first.md` | `<dialog>`, `<details>`, native over custom ARIA |
103| User Preferences | `rules/wcag-user-preferences.md` | prefers-reduced-motion, forced-colors, prefers-contrast, zoom |
104
105Cognitive inclusion (ADHD/autism/dyslexia support) is covered upstream by W3C COGA (see [Upstream coverage](#upstream-coverage-do-not-restate)); the house cognitive-load ceilings (notification cap, nav-item cap, reading-level targets) are in `references/ork-delta.md`.
106
107## Key Decisions
108
109| Decision | Recommendation |
110|----------|----------------|
111| Conformance level | WCAG 2.2 AA (legal standard: ADA, Section 508) |
112| Contrast ratio | 4.5:1 normal text, 3:1 large text and UI components |
113| Target size | 24px min (WCAG 2.5.8), 44px for touch |
114| Focus indicator | 3px solid outline, 3:1 contrast |
115| Component library | React Aria hooks for control, react-aria-components for speed |
116| State management | react-stately hooks (designed for a11y) |
117| Focus management | FocusScope for modals, roving tabindex for widgets |
118| Testing | jest-axe (unit) + Playwright axe-core (E2E) |
119
120## Anti-Patterns (FORBIDDEN)
121
122- **Div soup**: Using `<div>` instead of semantic elements (`<nav>`, `<main>`, `<article>`)
123- **Color-only information**: Status indicated only by color without icon/text
124- **Missing labels**: Form inputs without associated `<label>` or `aria-label`
125- **Keyboard traps**: Focus that cannot escape without Escape key
126- **Removing focus outline**: `outline: none` without replacement indicator
127- **Positive tabindex**: Using `tabindex > 0` (disrupts natural order)
128- **Div with onClick**: Using `<div onClick>` instead of `<button>` or `useButton`
129- **Manual focus in modals**: Using `useEffect` + `ref.focus()` instead of `FocusScope`
130- **Auto-playing media**: Audio/video that plays without user action
131- **ARIA overuse**: Using ARIA when semantic HTML suffices
132
133## Upstream coverage (do not restate)
134
135Vendor tutorials, API references, and criterion walkthroughs removed in the 2026-07-31 wrap-plus-delta thinning. Consult the first-party source; only the ork delta (floors, scars, house decisions) lives in `references/ork-delta.md`.
136
137| Topic | First-party source |
138|-------|--------------------|
139| WCAG 2.2 success-criterion walkthroughs and audit checklists | [WCAG 2.2 quick reference](https://www.w3.org/WAI/WCAG22/quickref/) and [WCAG 2.2 spec](https://www.w3.org/TR/WCAG22/) |
140| ARIA widget patterns and keyboard interaction models | [WAI-ARIA Authoring Practices Guide](https://www.w3.org/WAI/ARIA/apg/) |
141| React Aria hook APIs (useButton, useMenu, useComboBox, useModalOverlay, useTooltip, usePopover), component checklists, worked examples | [React Aria docs](https://react-spectrum.adobe.com/react-aria/) |
142| Focus trap, focus restoration, roving tabindex, and skip-link algorithms | [React Aria FocusScope](https://react-spectrum.adobe.com/react-aria/FocusScope.html) and [APG patterns](https://www.w3.org/WAI/ARIA/apg/patterns/) |
143| Cognitive accessibility guidance (COGA) | [W3C Making Content Usable](https://www.w3.org/TR/coga-usable/) |
144| Screen reader testing walkthroughs (NVDA, JAWS, VoiceOver, TalkBack) | [WebAIM screen reader testing](https://webaim.org/articles/screenreader_testing/) |
145
146## Detailed Documentation
147
148| Resource | Description |
149|----------|-------------|
150| `scripts/` | Templates: accessible form, focus trap, React Aria components |
151| `references/ork-delta.md` | Ork-specific floors, scars, and house decisions (cognitive ceilings, overlay recipe, canonical focus-trap selector) |
152| `references/ux-thresholds-quick.md` | UI/UX thresholds quick reference: contrast, touch targets, cognitive load, typography, forms |
153| `examples/wcag-examples.md` | Complete accessible form, modal, and navigation examples |
154
155## Related Skills
156
157- `ork:testing-e2e` - E2E testing patterns including accessibility testing
158- `design-system-starter` - Accessible component library patterns
159- `ork:i18n-date-patterns` - RTL layout and locale-aware formatting
160- `motion-animation-patterns` - Reduced motion and animation accessibility