Loading...
Loading...
Accessibility patterns for WCAG 2.2 compliance, keyboard focus management, and React Aria component patterns. Use when implementing screen reader support, keyboard navigation, ARIA patterns, focus traps, or accessible component libraries.
npx skill4agent add yonatangross/orchestkit accessibilityrules/| Category | Rules | Impact | When to Use |
|---|---|---|---|
| WCAG Compliance | 3 | CRITICAL | Color contrast, semantic HTML, automated testing |
| Focus Management | 3 | HIGH | Focus traps, focus restoration, keyboard navigation |
| React Aria | 3 | HIGH | Accessible components, form hooks, overlay patterns |
// 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>| Rule | File | Key Pattern |
|---|---|---|
| Color Contrast | | 4.5:1 text, 3:1 UI components, focus indicators |
| Semantic HTML | | Landmarks, headings, ARIA labels, form structure |
| Testing | | axe-core, Playwright a11y, screen reader testing |
| Rule | File | Key Pattern |
|---|---|---|
| Focus Trap | | Modal focus trapping, FocusScope, Escape key |
| Focus Restoration | | Return focus to trigger, focus first error |
| Keyboard Navigation | | Roving tabindex, skip links, arrow keys |
| Rule | File | Key Pattern |
|---|---|---|
| Components | | useButton, useDialog, useMenu, FocusScope |
| Forms | | useComboBox, useTextField, useListBox |
| Overlays | | useModalOverlay, useTooltip, usePopover |
| 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) |
<div><nav><main><article><label>aria-labeloutline: nonetabindex > 0<div onClick><button>useButtonuseEffectref.focus()FocusScope| Resource | Description |
|---|---|
| scripts/ | Templates: accessible form, focus trap, React Aria components |
| checklists/ | WCAG audit, focus management, React Aria component checklists |
| references/ | WCAG criteria reference, focus patterns, React Aria hooks API |
| examples/ | Complete accessible component examples |
testing-patternsdesign-system-starteri18n-date-patternsmotion-animation-patterns