-
Notifications
You must be signed in to change notification settings - Fork 7
Framework Accessibility
github-actions[bot] edited this page Feb 23, 2026
·
1 revision
Framework-specific accessibility patterns, common pitfalls, and code fix templates for React, Next.js, Vue, Angular, Svelte, and Tailwind CSS. Used when generating framework-aware accessibility fixes or checking framework-specific anti-patterns.
| Agent | Why |
|---|---|
| accessibility-lead | Orchestrated framework-aware audits |
| aria-specialist | Framework-specific ARIA misuse patterns |
| forms-specialist | Framework form label and validation patterns |
| keyboard-navigator | Route-change focus management patterns |
| Pattern | Issue | Fix |
|---|---|---|
onClick on <div>
|
Not keyboard accessible | Use <button> or add role="button", tabIndex={0}, onKeyDown
|
dangerouslySetInnerHTML |
May inject inaccessible content | Audit injected HTML for ARIA, headings, alt text |
Missing key on lists |
Can cause focus loss on re-render | Use stable keys (not array index) for interactive lists |
| Portal without focus trap | Focus escapes to background | Wrap portal in FocusTrap component |
No useEffect focus management on route change |
Focus not moved after navigation | Use useRef + useEffect to move focus to #main-content
|
// Route change focus management
useEffect(() => {
const main = document.getElementById('main-content');
if (main) { main.focus(); main.scrollIntoView(); }
}, [location]);
// Image with alt (Next.js)
<Image src="/hero.jpg" width={800} height={400} alt="Team collaborating in a modern office" />
// New tab link with warning
<a href={url} target="_blank" rel="noopener noreferrer">
Resource <span className="sr-only">(opens in new tab)</span>
</a>| Pattern | Issue | Fix |
|---|---|---|
v-if on live regions |
Removes element from DOM | Use v-show for live regions instead |
<transition> without focus |
Focus lost on transition | Manage focus in @after-enter hook |
<teleport> to body |
Outside app landmark tree | Add landmark roles to teleported content |
<!-- v-show keeps element in DOM for live region announcements -->
<div v-show="message" aria-live="polite">{{ message }}</div>| Pattern | Issue | Fix |
|---|---|---|
[aria-label] binding |
Invalid - ARIA is not a property | Use [attr.aria-label]
|
*ngFor without trackBy
|
Focus loss on list re-render | Add trackBy function |
No LiveAnnouncer for routes |
Navigation not announced | Inject LiveAnnouncer and announce route changes |
// Announce route changes
this.router.events.pipe(filter(e => e instanceof NavigationEnd))
.subscribe(() => this.liveAnnouncer.announce(`Navigated to ${this.getPageTitle()}`));| Pattern | Issue | Fix |
|---|---|---|
{#if} without focus management |
Focus lost when content appears | Use use:action to focus new content |
transition: without motion check |
Animations play regardless of user preference | Add prefers-reduced-motion check |
<script>
const reducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
</script>
<div transition:fly={{ y: reducedMotion ? 0 : 200, duration: reducedMotion ? 0 : 300 }}>
Content
</div>| Pattern | Issue | Fix |
|---|---|---|
outline-none alone |
Removes focus indicator | Pair with focus-visible:ring-2
|
text-gray-400 on bg-white
|
2.85:1 - fails 4.5:1 | Use text-gray-700 (6.62:1) |
No motion-reduce: variant |
Animations ignore user preference | Add motion-reduce:transition-none
|
| Background | Minimum Text | Ratio |
|---|---|---|
bg-white |
text-gray-600 |
4.55:1 |
bg-white |
text-gray-700 |
6.62:1 |
bg-gray-50 |
text-gray-700 |
6.29:1 |
bg-gray-900 |
text-gray-300 |
5.92:1 |
bg-blue-600 |
text-white |
5.23:1 |
<!-- Bad -->
<button class="outline-none">Submit</button>
<!-- Good -->
<button class="focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2">
Submit
</button>.github/skills/framework-accessibility/SKILL.md
- Accessibility Lead
- Web Accessibility Wizard
- Document Accessibility Wizard
- Alt Text and Headings
- ARIA Specialist
- Contrast Master
- Forms Specialist
- Keyboard Navigator
- Link Checker
- Live Region Controller
- Modal Specialist
- Tables Data Specialist
- Word Accessibility
- Excel Accessibility
- PowerPoint Accessibility
- PDF Accessibility
- Office Scan Config
- PDF Scan Config
- Testing Coach
- WCAG Guide