a11y-forms

Implements accessible form labels, required-field signaling, and error wiring in React and Next.js.

Updated Jul 27, 2026
One-click install
npx skills add https://github.com/arayaroma/ether --skill a11y-forms-arayaroma
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: a11y-forms
Source: https://github.com/arayaroma/ether/tree/main/skills/a11y-forms
Command: npx skills add https://github.com/arayaroma/ether --skill a11y-forms-arayaroma

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Forms are the most commonly flagged accessibility issue in code review: inputs without associated labels, required fields with no programmatic signal, and error messages screen readers never announce. This Skill provides concrete patterns and a checklist to build or review form inputs, selects, and textareas that work correctly with assistive technology. ## Core Features & Use Cases - Label Connection: Enforces htmlFor/id pairing so every input, select, and textarea has a programmatically associated label instead of relying on placeholders. - Required-Field Signaling: Combines visible asterisks (marked aria-hidden) with required and aria-required so the requirement is announced without redundant noise. - Error Message Wiring: Links error text via aria-describedby, marks it with role="alert", and keeps aria-invalid in sync with live validation state. - Use Case: While building a login form in React, apply the complete example to wire email and password fields with labels, validation errors announced via role="alert", and correct autoComplete attributes, then verify against the included checklist. ## Quick Start Review my React form component for accessibility issues and fix the label, required-field, and error-message wiring.

Frequently Asked Questions about a11y-forms

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

FAQPage Schema
How do I connect a label to an input in React?▼

Use the htmlFor attribute on the label matching the input's id, for example <label htmlFor="email"> paired with <input id="email">. This creates a programmatic association so screen readers announce the label when the input receives focus.

How do I announce form validation errors to screen readers?▼

Link the error text to the input with aria-describedby pointing at the error element's id, and add role="alert" to the error element so it is announced when it appears. Also set aria-invalid to reflect the current validation state.

Can I use placeholder text instead of a label?▼

No, placeholder is not a label substitute. It disappears once the user types and is not reliably announced by screen readers, so every input needs a real label element connected via htmlFor and id.

Should aria-describedby point to an empty element when there is no error?▼

No, set aria-describedby to undefined when there is no error rather than leaving it pointing at a non-existent or empty id. A dangling reference is worse for assistive technology than no reference at all.

How do I mark required form fields accessibly?▼

Combine the required or aria-required attribute with a visible indicator such as an asterisk wrapped in a span with aria-hidden="true". The asterisk is hidden from screen readers because aria-required already conveys the requirement.