frontend-a11y-aria-patterns
Frontend A11y ARIA Patterns
This skill defines the W3C WAI-ARIA 1.2 surface and the WAI Authoring Practices Guide (APG) pattern set required to ship accessible custom widgets. ARIA 1.2 is a stable W3C Recommendation; APG patterns are the normative-in-practice author guidance for combining roles, states, and keyboard models. This skill builds on [[frontend-syntax-html5-semantic]] (native elements first) and [[frontend-core-web-standards-baseline]] (browser AT support).
Sources : W3C: WAI-ARIA 1.2 (verified 2026-05-19), W3C: ARIA in HTML (verified 2026-05-19), W3C WAI: APG patterns (verified 2026-05-19), per-pattern URLs cited in methods.md.
Quick Reference
First rule of ARIA (verbatim, normative)
W3C: WAI-ARIA 1.2 (verified 2026-05-19) : "WAI-ARIA is intended to be used as a supplement for native language semantics, not a replacement. When the host language provides a feature that provides equivalent accessibility to the WAI-ARIA feature, use the host language feature."
Three operational consequences :
- NEVER add
roleto an element whose implicit role already satisfies the requirement (<nav>,<button>,<main>,<dialog>,<details>). - NEVER add
roleto an element if doing so contradicts the native role (<a role="button" href="...">strips link semantics;<button role="heading">is invalid). W3C: ARIA in HTML (verified 2026-05-19) : "Authors MUST NOT use the ARIA role and aria-* attributes in a manner that conflicts with the semantics." - ALWAYS prefer a composition of native elements over an ARIA pattern when both deliver the same accessibility (
<details><summary>over a Disclosure pattern;<dialog>showModal()over a customrole="dialog").