Loading...
Loading...
Comprehensive accessibility patterns for building, testing, and fixing accessible interfaces. Use when building UI components, forms, pages, or auditing code for accessibility issues.
npx skill4agent add moderndegree/agent-skills a11y-best-practices// Semantic elements with proper contrast
<button className="bg-slate-900 text-white focus-visible:ring-2">
Submit
</button>
// Explicit form labels
<label htmlFor="email">Email address</label>
<input id="email" type="email" aria-describedby="email-hint" />
<p id="email-hint">We'll never share your email.</p>
// Image with alt text
<img src="chart.png" alt="Sales increased 25% from Q1 to Q2" />
// Proper heading hierarchy
<h1>Page Title</h1>
<h2>Section</h2>
<h3>Subsection</h3>
// Skip link
<a href="#main" className="sr-only focus:not-sr-only">Skip to content</a>
<main id="main">// Using div as button (not keyboard accessible)
<div onClick={submit}>Submit</div>
// Placeholder only (invisible on focus)
<input placeholder="Enter email" />
// Missing alt text
<img src="photo.jpg" />
// Heading skip (h1 → h3)
<h1>Title</h1>
<h3>Subtitle</h3>
// Generic link text
<a href="/details">Click here</a> to learn more
// No focus indicator
<button className="outline-none">Action</button>