Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
sergiodxa avatar

Frontend Accessibility Best Practices

  • 503 installs
  • 93 repo stars
  • Updated February 1, 2026
  • sergiodxa/agent-skills

frontend-accessibility-best-practices is a React-focused agent skill that encodes seven WCAG accessibility rules across semantic HTML, screen readers, keyboard flows, and user preferences for developers who need inclusiv

About

frontend-accessibility-best-practices is a sergiodxa/agent-skills reference for building inclusive React applications with WCAG-minded patterns. It organizes seven rules across four categories—semantic HTML landmarks, screen reader support with sr-only text and aria-live regions, keyboard and focus management including react-aria Modal trapping, and user preference handling for reduced motion and 44x44px touch targets. Each rule links to a dedicated markdown reference with bad versus good TSX examples using semantic elements, role="alert", focus-visible rings, and motion-reduce utilities. Developers reach for frontend-accessibility-best-practices when creating components, forms, navigation, dynamic notifications, or reviewing UI pull requests for screen-reader and keyboard compliance.

  • Semantic HTML and landmark structure
  • Keyboard navigation and focus order
  • ARIA roles without overuse
  • Color contrast and motion preferences
  • Accessible forms, modals, and live regions

Frontend Accessibility Best Practices by the numbers

  • 503 all-time installs (skills.sh)
  • +13 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #623 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/sergiodxa/agent-skills --skill frontend-accessibility-best-practices

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs503
repo stars93
Last updatedFebruary 1, 2026
Repositorysergiodxa/agent-skills

How do you implement WCAG accessibility in React components?

Implement WCAG-minded markup, keyboard flows, ARIA, contrast, and focus management while building UI so sites ship accessible to screen readers and keyboard users.

Who is it for?

Frontend engineers building or reviewing React and react-aria-components UI who want concrete WCAG patterns for forms, modals, icon buttons, and dynamic status updates.

Skip if: Non-React stacks, teams needing formal VPAT or legal compliance certification, or projects where automated axe scans alone are sufficient without component-level guidance.

When should I use this skill?

The user is creating React UI, forms, modals, icon buttons, or dynamic notifications and asks for accessibility, a11y, WCAG, ARIA, keyboard, or screen-reader support.

What you get

Accessible React components using semantic landmarks, sr-only labels, aria-live regions, focus-visible styles, modal focus traps, and motion-safe animations.

  • accessible TSX components
  • ARIA landmark structure
  • keyboard-navigable controls

By the numbers

  • Contains 7 accessibility rules organized into 4 categories
  • Specifies 44x44px minimum touch target sizing for interactive controls
  • Links 7 dedicated rule reference markdown files under @rules/

Files

SKILL.mdMarkdownGitHub ↗

Accessibility Best Practices

Accessibility patterns for building inclusive React applications following WCAG standards. Contains 7 rules across 4 categories focused on semantic HTML, screen reader support, keyboard navigation, and user preferences.

When to Apply

Reference these guidelines when:

  • Creating new UI components
  • Building forms and interactive elements
  • Adding dynamic content or notifications
  • Implementing navigation patterns
  • Reviewing code for accessibility

Rules Summary

Semantic HTML & Structure (HIGH)

semantic-html-landmarks - @rules/semantic-html-landmarks.md

Use semantic HTML elements for page structure.

// Bad: divs with class names
<div className="header">...</div>
<div className="nav">...</div>
<div className="content">...</div>

// Good: semantic elements
<header>...</header>
<nav aria-label={t("Primary")}>...</nav>
<main>...</main>
<footer>...</footer>

Screen Readers (MEDIUM)

screen-reader-sr-only - @rules/screen-reader-sr-only.md

Use sr-only class for visually hidden text.

// Icon-only buttons need accessible labels
<Button variant="icon" onPress={onClose}>
  <XMarkIcon aria-hidden="true" />
  <span className="sr-only">{t("Close")}</span>
</Button>

// Visually hidden section headings
<section>
  <h2 className="sr-only">{t("Search results")}</h2>
  <SearchResultsList />
</section>
aria-live-regions - @rules/aria-live-regions.md

Announce dynamic content changes to screen readers.

// Error messages - announced immediately
{
  error && (
    <p role="alert" className="text-failure-600">
      {error}
    </p>
  );
}

// Status updates - announced politely
<div role="status" aria-live="polite">
  {t("{{count}} results found", { count })}
</div>;

Keyboard & Focus (HIGH)

keyboard-navigation - @rules/keyboard-navigation.md

Use semantic elements for built-in keyboard support.

// Bad: div with onClick not keyboard accessible
<div onClick={handleClick}>Click me</div>

// Good: button has Enter/Space support
<button onClick={handleClick}>Click me</button>

// Good: react-aria Button handles everything
import { Button } from "react-aria-components";
<Button onPress={handlePress}>Click me</Button>
focus-management - @rules/focus-management.md

Show visible focus indicators and trap focus in modals.

// Always use focus-visible for focus styles
<button className="focus-visible:ring-2 focus-visible:ring-teal-600">
  Click me
</button>;

// react-aria Modal handles focus trapping automatically
import { Modal, Dialog } from "react-aria-components";
<Modal isOpen={isOpen}>
  <Dialog>{/* Focus automatically trapped here */}</Dialog>
</Modal>;

User Preferences (MEDIUM)

reduced-motion - @rules/reduced-motion.md

Respect prefers-reduced-motion setting.

import { usePrefersReducedMotion } from "~/hooks/use-prefers-reduced-motion";

// CSS approach
<div className="animate-bounce motion-reduce:animate-none">
  Bouncing content
</div>;

// JS approach
function AnimatedCounter({ value }) {
  let prefersReducedMotion = usePrefersReducedMotion();
  if (prefersReducedMotion) return <span>{value}</span>;
  return <CountUp target={value} />;
}
touch-targets - @rules/touch-targets.md

Ensure 44x44px minimum touch targets.

// Icon buttons need explicit sizing
<Button variant="icon" className="h-11 w-11">
  <XMarkIcon className="h-5 w-5" />
  <span className="sr-only">{t("Close")}</span>
</Button>

// Links need padding for tappable area
<Link to={href} className="block py-3 px-4">
  {label}
</Link>

Key Files

  • app/components/heading.tsx - Region, Heading, Main components
  • app/hooks/use-prefers-reduced-motion.ts - Reduced motion hook
  • app/components/field/field.tsx - Accessible form field component

Related skills

How it compares

Use frontend-accessibility-best-practices for React component patterns during implementation; run dedicated audit skills or Lighthouse when you need site-wide automated scans.

FAQ

How many rules does frontend-accessibility-best-practices include?

frontend-accessibility-best-practices defines seven rules grouped into four categories: Semantic HTML and Structure, Screen Readers, Keyboard and Focus, and User Preferences. Each rule has a linked reference file with TSX examples.

Which React libraries does frontend-accessibility-best-practices reference?

frontend-accessibility-best-practices examples use react-aria-components Button, Modal, and Dialog for keyboard and focus trapping, plus Tailwind utilities such as sr-only, focus-visible rings, and motion-reduce classes.

When should aria-live regions be polite versus alert?

frontend-accessibility-best-practices uses role="alert" for error messages that must announce immediately and role="status" with aria-live="polite" for non-critical count or progress updates such as search result totals.

Frontend Developmentfrontendtesting

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.