Template · Accessibility specification

Component spec Template

One document for each component: the element it is built on, how it works with a keyboard and a screen reader, where focus goes, and how you will test it. Write it with the designer and the developer before the first line of code, and keep it beside the component in your design system.

Version
1.0
Updated
2026-10-07
Standard
WCAG 2.2 AA
Format
Markdown
Patterns from
WAI-ARIA APG
Licence
CC0 1.0

Download

The files

Plain text files you can open anywhere.

Markdown

The spec

component-spec.md

Thirteen sections to fill in, each with a table or a checklist and the WCAG 2.2 criteria behind it. Make one copy for each component.

Format
Markdown text (.md)
Size
12,286 bytes
Contents
212 lines

Preview: the first 17 lines

# Accessibility specification: [name of the component]

> Template version 1.0, 2026-10-07, from https://auricartisan.com/templates/component-spec/
> Licence: CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/). Copy it, change it and use it for anything; no credit needed.
> Write this before the component is built, and keep it with the component in your design system.
> Replace everything in [square brackets], delete the parts that do not apply, then delete this note.

| Spec | |
|---|---|
| Component | [Name, as the design system calls it] |
| Spec version | [1.0] |
| Status | [Draft / In review / Agreed] |
| Owner | [Name, team] |
| Last reviewed | [YYYY-MM-DD] |
| Design | [Link to the design file] |
| Code | [Link to the code, or "Not built yet"] |
| Standard | [WCAG 2.2, Level AA] |
Download the file

Licence: CC0 1.0 Universal, a public domain dedication. Copy, change and use these files for anything, including paid work, without asking or giving credit. The files are plain ASCII text in English, so they open the same everywhere.

What goes in it

What goes in a component spec

Thirteen sections, roughly in the order a team decides them. Delete what does not apply: a component with nothing to operate needs no keyboard table.

  1. Purpose. What the component is for, when to use it, and when to use something else.
  2. Anatomy. Every part by name, so the design, the code and the spec use the same words.
  3. Variants and states. Each size, style and state, how it looks, and how assistive technology is told about it.
  4. Semantics. A native HTML element first, otherwise an ARIA role; then the accessible name, the states and the properties.
  5. Keyboard. A table of each key, where focus is when it is pressed, and what it does.
  6. Focus management. Where focus goes when something opens, closes, is deleted or shows an error.
  7. Screen reader announcements. What is announced and when, with a live region only for a change away from focus.
  8. Pointer and touch. Targets of at least 24 by 24 CSS pixels (2.5.8, Level AA) or one of its exceptions, an alternative to dragging, and content shown on hover.
  9. Color and contrast. 4.5:1 for text, 3:1 for the parts of a control and its states, and never color alone.
  10. Motion. What moves, and what replaces the movement when the reduced motion setting is on.
  11. Content and language. Labels, error messages, text in other languages, and right-to-left layouts.
  12. Test cases. Checklists for the keyboard, screen readers, zoom and reflow, pointer and touch, and automated checks.
  13. Related patterns and references. The pattern it follows, the WCAG criteria that apply, and links to the design, the code and the tests.

Example

A disclosure button, key by key

The keyboard section of a spec for a show/hide button, following the Disclosure pattern in the WAI-ARIA Authoring Practices Guide. The trigger is a native button element, and the content comes straight after it.

A disclosure button, key by key (table)
KeyWhat it doesThe button's state afterwards
EnterShows the content if it is hidden, and hides it if it is shown. Focus stays on the button.aria-expanded changes from false to true, or back.
SpaceThe same as Enter.aria-expanded changes from false to true, or back.
TabMoves focus to the next element that can take it. When the content is shown and holds a link or a control, that comes next.No change.
Shift+TabMoves focus to the previous element that can take it.No change.

Enter and Space come from the APG pattern; Tab and Shift+Tab are the browser's own, listed so that nothing overrides them. The button has aria-expanded: true when the content is shown, false when it is hidden. aria-controls, pointing at the content's id, is optional.

How to use it

From a blank page to an agreed spec

  1. Start from a pattern. Find the closest pattern, on this site or in the APG, and take its semantics, keys and focus rules rather than inventing new ones. Browse the accessibility patterns
  2. Fill it in together. Design, engineering and content each answer the sections they know best, and agree the rest before any code is written.
  3. Decide focus and announcements on paper. Where focus goes after a close or a delete, and what a screen reader says when something changes, are easy to leave to chance. Write them down.
  4. Turn the tests into acceptance criteria. Each test case in section 12 becomes a check the story must pass before it is done. Use the acceptance criteria template
  5. Keep it with the component. Store it beside the component's code or its design system page, give it a version, and update it whenever the component changes.

Native first

A role is a promise, not a behavior

A native element such as button, a, input or details brings its role, its keyboard support and its states with it. An ARIA role only changes what assistive technology is told, so a div with role="button" still needs tabindex, Enter and Space added by hand.

A spec records decisions, not results. It shows the component was designed to be accessible; the tests in section 12 show whether it is.

Next

Related templates and tools

Sources

Where this comes from

Written by Auric Artisan. Not yet reviewed by an independent accessibility specialist.

Suggest a change to the template