frontend-a11y

Implements accessibility patterns for React and Next.js components including ARIA, keyboard navigation, and focus management.

5|15|Updated Jul 8, 2026
One-click install
npx skills add https://github.com/clfigueiredo/hermes-infra-skills --skill frontend-a11y-clfigueiredo
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: frontend-a11y
Source: https://github.com/clfigueiredo/hermes-infra-skills/tree/main/.hermes/skills/curso-hermes/frontend-a11y
Command: npx skills add https://github.com/clfigueiredo/hermes-infra-skills --skill frontend-a11y-clfigueiredo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Interactive React and Next.js components frequently fail accessibility requirements: form inputs lack connected labels, error messages are invisible to screen readers, clickable divs ignore keyboard users, and modals trap or lose focus. This Skill provides concrete, review-ready patterns that fix the issues most commonly flagged in code review. ## Core Features & Use Cases - Form Accessibility: Connect labels via htmlFor/id, link error messages with aria-describedby and role="alert", and signal required fields with aria-required. - ARIA and Semantic HTML: Apply aria-label, aria-labelledby, aria-live, aria-expanded, and aria-controls correctly, and replace non-semantic divs with native buttons and anchors. - Keyboard Navigation and Focus Management: Build keyboard-operable dropdowns with arrow-key handling and modals that save and restore focus on open and close. - Use Case: When building a login form or modal dialog in a Next.js app, apply these patterns so screen reader users receive proper announcements and keyboard users can complete every interaction without a mouse. ## Quick Start Review my React form component and fix all accessibility issues including missing labels, error announcements, and keyboard support.

Frequently Asked Questions about frontend-a11y

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make React forms accessible to screen readers?▼

Connect every input to a label using htmlFor and matching id, link error messages with aria-describedby and role="alert", and mark required fields with aria-required. This lets screen readers announce the label, state, and errors for each field.

How to handle keyboard navigation in a custom React dropdown?▼

Use role="combobox" with aria-expanded and aria-haspopup, track the active option index in state, and handle ArrowDown, ArrowUp, Enter, Space, and Escape in onKeyDown. Render options with role="option" and aria-selected.

When should I use aria-label versus aria-labelledby?▼

Use aria-label with an inline string when no visible label text exists, such as icon-only buttons. Use aria-labelledby to reference another element's id when a visible label already exists on the page, avoiding duplicated text.

Does this accessibility approach work with Next.js?▼

Yes, all patterns use standard React APIs like useState, useEffect, useRef, and useId, which work in both React and Next.js components. The examples are written in TSX and apply directly to Next.js app or pages router projects.

Why is onClick on a div an accessibility problem?▼

A div with onClick has no role, no keyboard focusability, and no accessible name, so keyboard and screen reader users cannot interact with it. Use a native button element, or add role, tabIndex, and onKeyDown handlers as a fallback.

How do I manage focus when opening and closing a modal in React?▼

Store document.activeElement in a ref before opening, move focus into the modal container with tabIndex={-1}, and restore focus to the saved element on close. For full Tab cycling traps, use a library like focus-trap-react.