You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
Fix Templates
// Route change focus managementuseEffect(()=>{constmain=document.getElementById('main-content');if(main){main.focus();main.scrollIntoView();}},[location]);// Image with alt (Next.js)<Imagesrc="/hero.jpg"width={800}height={400}alt="Team collaborating in a modern office"/>// New tab link with warning<ahref={url}target="_blank"rel="noopener noreferrer">Resource<spanclassName="sr-only">(opensinnewtab)</span>
</a>
Vue
Common Pitfalls
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
Fix Template
<!-- v-show keeps element in DOM for live region announcements -->
<divv-show="message" aria-live="polite">{{ message }}</div>
Angular
Common Pitfalls
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
Fix Template
// Announce route changesthis.router.events.pipe(filter(e=>einstanceofNavigationEnd)).subscribe(()=>this.liveAnnouncer.announce(`Navigated to ${this.getPageTitle()}`));
<!-- Bad --><buttonclass="outline-none">Submit</button><!-- Good --><buttonclass="focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2">
Submit
</button>