--- name: ng-accessibility description: Make an Angular (v17+) application accessible – semantic HTML, keyboard & focus, color contrast, text alternatives, accessible forms & tables, plus Angular-specific tooling (ARIA attribute bindings, CDK a11y LiveAnnouncer/cdkTrapFocus, Angular Aria & Material, accessible custom components, router titles/active-links/focus management). Use when the user wants to improve accessibility/a11y, meet WCAG AA, fix screen-reader or keyboard issues, pass axe/Lighthouse a11y audits, or asks for an accessibility review. Covers the angular.dev a11y best practices. license: MIT metadata: author: Alexander Thalhammer version: '1.0' --- # Angular Accessibility (a11y) A practical guide to building Angular apps everyone can use. Two layers: **WCAG fundamentals** (the HTML/CSS you author) and **Angular tooling & patterns** (CDK, Aria, router, custom components). Target is **WCAG 2.x AA**. > Targets Angular v17+ (standalone + signals). Accessibility is a requirement, not a polish step – > build it in from the first component. ## 0. Verify – don't assume a11y can't be eyeballed. Run all four: - **Automated:** axe DevTools (or Lighthouse a11y audit) – catches ~30–50% of issues. Check for a `playwright.config.ts` first; once it exists, bake AXE checks into the e2e suite via `@axe-core/playwright` and run them against key views – see the create-e2e-tests skill for scaffolding Playwright and wiring assertions into a spec. - **Keyboard-only:** unplug the mouse. Tab through everything; every interactive element must be reachable, operable, and have a **visible focus** indicator. - **Screen reader:** VoiceOver (macOS), NVDA (Windows), or TalkBack. - **Lint:** enable `@angular-eslint` accessibility template rules (alt-text, label-has-associated-control, click-events-have-key-events, valid-aria, etc.) to catch issues at author time. --- ## Part 1 – WCAG Fundamentals > These are the web-a11y basics you author in HTML/CSS – kept terse here. For the project's > house rules and do/don't lists, see [style-guide.a11y.md](../../../style-guide/style-guide.a11y.md). ### 1.1 Semantic HTML & structure Native elements carry meaning and behavior for free: use landmarks (`
`, `