Rules of thumb
When a guide offers more than one fix and recommends one, the reason is usually one of these. Each rule lists the guides that rely on it.
Use native HTML first
When an HTML element does the job, use it, and reach for ARIA only when none does.
Why
- Behaviour comes with the element. A button responds to Enter and Space, a label puts focus in its field when clicked, and a dialog opened with showModal() keeps focus out of the page behind it. With a div and ARIA, you write each of those yourself, and they are easy to leave out.
- ARIA changes what is announced, not what happens. role="button" makes a screen reader say "button", but the element still ignores the keyboard until you add the code. A screen reader user is told one thing and gets another.
- Native elements work in more places. Browser autofill, voice control, forced colors, reader views and older assistive technology all understand label, button and select. Support for ARIA roles and attributes is uneven across them.
- There is less to keep working. Browsers maintain native behaviour and fix it for you. Hand-written ARIA and its scripts break silently when markup is renamed, a component is updated or a script fails to load.
<label for="phone">Phone</label>
<input id="phone" type="tel"><div id="phone-label">Phone</div>
<input type="tel" aria-labelledby="phone-label">Guides that rely on it (63)
- Filter links that don't say which is chosen or what changed
- Buttons announced as links that Space can't press
- Buttons that act on press and can't be cancelled
- Toggle buttons that don't say whether they are pressed
- Buttons that work only by touch on touchscreen devices
- Custom checkboxes that keyboards and screen readers skip
- Custom dropdowns that keyboards and screen readers can't use
- Date fields that don't say which format to type
- Date pickers that can't be typed in or used by keyboard
- Multi-selects whose ticks are never read out
- Quantity steppers with unnamed buttons and no typing
- Tag chips whose × the keyboard never reaches
- Range sliders that only move by dragging
- Star ratings that keyboards and screen readers skip
- Toggle switches that don't say whether they are on
- Carousels that keyboard and screen reader users can't use
- Expandable table rows a keyboard can't open
- Product photo zoom that needs a mouse
- Product photo thumbnails that need a mouse or say nothing
- Action menus that open silently, out of keyboard reach
- Seat maps keyboards can't use and screen readers can't read
- Toolbars of clickable icons a keyboard can't reach
- Tree views keyboards can't open and screen readers flatten
- Chat buttons that Tab skips, and close buttons with no name
- Pop-ups that can't be closed with a keyboard
- Confirmation dialogs that don't read out their question
- Cookie banners that hide keyboard focus and come last
- Floating buttons and panels that keyboard focus reaches last
- Tooltips that vanish on approach and can't be dismissed
- Modals that leave keyboard focus behind them
- Search panels that close on Tab and drop keyboard focus
- Accordions that don't say whether a panel is open
- Show and hide buttons that don't say whether they are open
- Code boxes where a keyboard can't correct a wrong digit
- Radio buttons and checkboxes without a group name
- Form fields with missing or mismatched labels
- One-time code boxes that won't take a pasted code
- Select-all checkboxes whose dash is never read out
- Split date and phone fields with no name for each box
- aria-label on divs and spans that screen readers often skip
- Comparison tables with ticks and crosses that read as blank
- Decorative images read out as file names or repeated text
- Emoji read out by their names, not their meaning
- SVG icons with no name, or read when they should be silent
- Videos a keyboard can't play, or with no captions button
- Keyboard traps in editors and form fields
- Div buttons that can't be reached with Tab
- Progress bars and meters that screen readers can't read
- Dropdown parent links that open the submenu, not the page
- Navigation menus built as an app's menu bar
- Hover-only dropdowns, or ones that never say they are open
- Iframes with a missing or generic title
- Headings that don't match the page's sections
- Landmarks that are missing, misplaced or leave content out
- Lists built from divs, icons and typed numbers
- Search boxes and related items left out of the landmark list
- Invalid ARIA that misleads screen readers
- Chart legends a keyboard can't toggle
- Editable data grids a keyboard can't move through or edit
- Sortable tables that show the sort only as an arrow
- Tables with a title but no caption
- Data tables with headers that are only bold text
- Modals cut off at the top and bottom when zoomed in
Sources
- W3C, Using ARIA: the first rule of ARIA use (opens in a new tab)
- W3C ARIA Authoring Practices Guide: No ARIA is better than bad ARIA (opens in a new tab)
- W3C, HTML Accessibility API Mappings: how browsers expose each native element (opens in a new tab)
- a11ysupport.io: tested support for HTML and ARIA across browsers and screen readers (opens in a new tab)
- MDN: ARIA (opens in a new tab)
Make motion opt-in
Write every CSS animation and transition that moves something inside @media (prefers-reduced-motion: no-preference), so movement is added for people who have not asked for less, never removed afterwards.
Why
- Nothing can be forgotten. An override under prefers-reduced-motion: reduce has to name every animation again, and the next one someone adds will not be on the list. Motion that only exists inside no-preference is off by default.
- It also covers browsers and devices that cannot report the setting. They match neither query value, so they get the still page, which works for everyone.
- The resting state is the real one. Content that starts hidden or off-screen only inside the query can never be stuck there for people who reduced motion.
- It respects a choice the visitor has already made once, in their system settings, for every site. Vestibular disorders, migraine and concussion make large movement physically unpleasant, and many people turn the setting on for that reason.
@media (prefers-reduced-motion: no-preference) {
.panel { transition: transform 300ms; }
}.panel { transition: transform 300ms; }
@media (prefers-reduced-motion: reduce) {
.panel { transition: none; }
}Guides that rely on it
- Pulsing buttons, glowing badges and endless animations
- Animations that ignore the reduced-motion setting
Sources
- W3C, Understanding 2.3.3 Animation from Interactions (opens in a new tab)
- W3C technique C39: using the CSS reduce-motion query to prevent motion (opens in a new tab)
- Tatiana Mac: taking a no-motion-first approach to animations (opens in a new tab)
- A List Apart: designing safer web animation for motion sensitivity (opens in a new tab)
- MDN: prefers-reduced-motion (opens in a new tab)
Let people stop anything that moves by itself
When something would move, scroll, blink or change by itself for more than five seconds beside other content, such as a ticker, a carousel or a looping animation, either let it change only when someone asks, or put a button before it that stops it and keeps it stopped; pausing on hover or focus is neither.
Why
- Movement pulls the eye. People with attention difficulties keep being drawn back to it and lose their place in what they were reading, and nothing the page offers lets them make it stop.
- Moving text runs ahead of slow readers and magnifier users. A message that slides away or a slide that changes after six seconds is gone before they finish it.
- Hover and focus are not a way to stop it. A pause on hover needs a mouse and ends when the pointer moves; a pause on focus ends when focus moves. Keyboard, touch and voice users get nothing, and the movement comes back the moment anyone looks away.
- Not moving at all is the simplest way to meet it. Content that changes only when someone presses a button needs no Stop control, and no one has to find one.
- A real button reaches everyone. A native button before the moving content is the first thing the keyboard meets, a screen reader names it, voice control can say it, and it stays stopped until someone presses it again.
- The reduced-motion setting helps but is not enough. Not everyone who is distracted by movement knows it is there, and some use a computer they cannot change, so the page needs its own control as well.
<button type="button" aria-pressed="false">Pause announcements</button>
<div class="ticker">…</div><div class="ticker">…</div>
.ticker:hover .ticker-track { animation-play-state: paused; }Guides that rely on it (4)
Sources
- W3C, Understanding 2.2.2 Pause, Stop, Hide (opens in a new tab)
- W3C technique G4: allowing the content to be paused and restarted from where it was paused (opens in a new tab)
- W3C failure F16: scrolling content with no way to pause it (opens in a new tab)
- W3C carousels tutorial: animations, and a control to stop them (opens in a new tab)
- ARIA Authoring Practices: the carousel pattern and its rotation control (opens in a new tab)
Move to show a change, then stop
Let something move when the movement shows what changed, such as a bar filling to its new value, a panel opening or an item sliding to its new place, and let it stop when the change does; motion that only decorates, such as a shimmer, a pulse or stripes on a finished bar, either stops within five seconds or doesn’t run.
Why
- Motion that tracks a change carries information. A fill that grows shows how far an upload has got, and a panel that slides open shows where its content came from. It ends when the change ends, so it never competes with what people read next.
- Decorative motion keeps going after there is nothing left to tell. A shimmer on a link, a pulsing button or stripes sliding on a finished bar pull the eye away from the content for as long as the page is open, which is what makes reading hard for people with attention difficulties.
- Five seconds is the line WCAG draws. Anything that moves by itself beside other content for longer than that needs a way to pause, stop or hide it, so decoration that stops sooner needs no control at all.
- A loading animation is the one exception, and a narrow one. It counts as essential only while nothing else on the page can be used and the motion is what shows the page hasn’t frozen. Once people can carry on with the page, or the load is done, it is decoration again.
- Meaningful motion is still opt-in. The change must also show without movement, in the new value, the open panel or the new position, so the animation can sit inside prefers-reduced-motion: no-preference and nothing is lost when it doesn’t run.
.fill { width: 60%; }
@media (prefers-reduced-motion: no-preference) {
.fill { transition: width 0.4s ease-out; }
}.bar.done .fill {
animation: stripes 1s linear infinite;
}Guides that rely on it (15)
- Filter links that don't say which is chosen or what changed
- "Read more" links that all say the same thing
- Custom checkboxes that keyboards and screen readers skip
- Form errors that don't say how to fix them
- AI rewrite buttons that replace text with no preview or undo
- Skip links that are missing or can't be reached
- Add to cart buttons that change a badge and say nothing
- Character counters that stay silent or speak on every key
- Countdown timers that screen readers keep reading out
- Form success and error messages that are never announced
- Inline form errors read out while typing, or not at all
- Forms replaced by a thank-you that is never announced
- Background videos that loop with no pause button
- Pulsing buttons, glowing badges and endless animations
- Tickers, carousels and animations that can't be paused
Sources
- W3C, Understanding 2.2.2 Pause, Stop, Hide, including its note on loading animations (opens in a new tab)
- W3C technique G186: a control in the page that stops moving, blinking or auto-updating content (opens in a new tab)
- Nielsen Norman Group: the role of animation and motion in UX (opens in a new tab)
- Material Design 3: motion that informs, focuses and expresses (opens in a new tab)
Flash no more than three times a second
Keep anything that flashes, at any size, to three flashes or fewer in any one second, or don't flash at all, rather than counting on the flash being small or dim enough to pass the thresholds.
Why
- A seizure can start before anyone can act. W3C notes that turning a flash off is not an option, because a seizure could come faster than most people could turn it off, so a warning or a Pause button comes too late.
- Three a second needs no measuring. WCAG notes that no tool is needed when nothing flashes more than three times in any one second; the size and brightness thresholds need a flash analysis tool, and must hold at the largest size anyone views the page.
- Size depends on the viewer, not the author. Zoom, a screen magnifier or a phone held close make a small flash cover more of what someone sees, so a flash that passes on the designer's screen can fail on someone else's.
- Most seizures come from faster flashing. Flashes between 3 and 30 a second are the most common trigger and sensitivity below three a second is uncommon, so the rule stays clear of the range that matters.
@media (prefers-reduced-motion: no-preference) {
.sale { animation: blink 1s steps(1) 3; }
}.sale { animation: blink 0.2s steps(1) infinite; }Guides that rely on it
- Badges and icons that blink more than three times a second
- Flashing banners and videos that can trigger seizures
Sources
- W3C, Understanding 2.3.1 Three Flashes or Below Threshold (opens in a new tab)
- W3C, Understanding 2.3.2 Three Flashes (opens in a new tab)
- W3C technique G19: ensuring that no component of the content flashes more than three times in any 1-second period (opens in a new tab)
- Epilepsy Society: photosensitive epilepsy, and the flash rates that trigger it (opens in a new tab)
Show a message next to what it is about
Put a status or error message beside the field, button or content it reports on, not in a corner of the page.
Why
- Magnifier users see only part of the screen. Someone zoomed in on the field they are typing in never sees a toast in the far corner, and it may be gone before they could pan to it.
- Nearness says what the message belongs to. People read things placed together as related, so "Saved" under the editor is clearly about the editor, while the same word in a corner could be about anything.
- People are already looking there. A message beside the thing they just used is seen without searching, so they can act on it at once instead of hunting for it or returning to what they thought was done.
- It can stay. A message in its own place can remain until it is out of date, so people can read it again; a toast in a shared corner has to go to make room for the next one.
<textarea id="note"></textarea>
<p role="status">Draft saved at 10:42.</p><textarea id="note"></textarea>
…
<div class="toast-corner" role="status">Saved</div>Guides that rely on it (8)
- Filter links that don't say which is chosen or what changed
- Toasts that vanish before you can read or undo them
- Form errors that don't say how to fix them
- Error summaries that don't say which fields failed
- Add to cart buttons that change a badge and say nothing
- Form success and error messages that are never announced
- Status messages that are shown but never announced
- Forms replaced by a thank-you that is never announced
Sources
- W3C WAI, How People with Disabilities Use the Web: visual (screen magnification shows small parts of the screen at a time) (opens in a new tab)
- W3C, Understanding 4.1.3 Status Messages: proximity to other content gives a message its visual context (opens in a new tab)
- Nielsen Norman Group: proximity principle in visual design (opens in a new tab)
- Nielsen Norman Group: show error indicators near the field (opens in a new tab)
Interrupt only for what can't wait
Send routine news, such as saved, added, updated or a new comment, to a polite status region that waits for the screen reader to finish, and keep role="alert" and aria-live="assertive" for a message people must act on now, such as a lost connection or a failed payment.
Why
- An assertive message can cut in. ARIA gives it the highest priority, to be presented immediately, and lets the screen reader drop the messages that were waiting. VoiceOver does cut in, on macOS and iPadOS, breaking off whatever the person was listening to.
- W3C counts it as a failure. Understanding 4.1.3 lists role="alert" or aria-live="assertive" on content that is not important and time-sensitive among its failures, and says status messages should reach people without unnecessarily interrupting their work.
- Urgency only works when it is rare. When every notice interrupts, the one that matters sounds like all the others, and JAWS and Narrator read alerts like any other message anyway, so its words have to say it is urgent; MDN warns that the alert role is intrusive and must be used sparingly, and that several alerts at once make for a bad experience.
- Polite messages are still heard. A status region is read as soon as the screen reader finishes what it is saying, so routine news reaches people a moment later and nothing they were reading is lost.
<p id="notice-status" role="status"></p>
<p id="notice-alert" role="alert"></p>
<!-- "Sam opened this task" → status; "Connection lost" → alert --><div id="notices" role="alert"></div>
<!-- Every notice, routine or not, goes here. -->Guides that rely on it (5)
Sources
- W3C, Understanding 4.1.3 Status Messages: role="alert" or aria-live="assertive" on content that is not important and time-sensitive is listed as a failure (opens in a new tab)
- W3C, WAI-ARIA 1.2, aria-live: assertive updates have the highest priority, and queued changes may be cleared (opens in a new tab)
- MDN: the alert role is intrusive and must be used sparingly; several alerts at once, and unnecessary alerts, create bad experiences (opens in a new tab)
- MDN: aria-live, don't use the assertive value unless the interruption is imperative (opens in a new tab)
Say it once, when the change has settled
When something changes in steps, such as a field being typed in, a count going down or a reply streaming in, write its message into the live region once the change has settled (typing has paused, a limit is near, the reply is complete), not at every step.
Why
- Every write is a message. A live region reports each change to its content, so a count written on every keystroke, or a reply written a few words at a time, reaches people as a run of fragments that queue up behind each other or are dropped half read.
- A message sent too early is already out of date. An error for an address still being typed, or a count two keys behind, reports a state the person was about to change. Nielsen Norman Group calls it frustrating to see an error before being given the chance to finish typing.
- The W3C's own examples wait. The WAI forms tutorial checks a username as it is typed and has its message read once, when the person stops typing, and ARIA describes aria-busy for changes to a live region made in steps that should be spoken as one unit when they are complete. Screen readers don't all honour aria-busy, so writing the message once is the dependable way.
- Settled is not silent. Something is still said at the end: the result of the check, the count as the limit nears, the whole reply. GOV.UK's character count is announced when people stop typing. Waiting decides when a message is read, not whether.
const sayCount = debounce(() => {
status.textContent = `${left} characters left`;
}, 1000);
field.addEventListener('input', sayCount);field.addEventListener('input', () => {
status.textContent = `${left} characters left`;
});Guides that rely on it (4)
Sources
- W3C WAI tutorial, User notifications: a message checked while typing is read once, when the user stops typing (opens in a new tab)
- W3C, WAI-ARIA 1.2, aria-busy: changes to a live region made in steps can be spoken as a single unit when complete (opens in a new tab)
- Nielsen Norman Group: avoid showing an error until the user has finished with the field (opens in a new tab)
- GOV.UK Design System, Character count: screen reader users hear the count when they stop typing (opens in a new tab)
- W3C, Understanding 4.1.3 Status Messages: status messages should reach people without unnecessarily interrupting their work (opens in a new tab)
Style from the state, not a class
Draw a control's current, open, pressed or invalid look from the attribute that tells assistive technology that state, not from a separate class.
Why
- The look and the announcement cannot disagree. When the style selects on aria-current, aria-expanded or aria-pressed, the state a screen reader announces and the state people see come from one value, so they cannot end up on different elements.
- A missing attribute shows. If the code forgets the attribute, the style is missing too, so a sighted tester sees the bug. With a separate class, the page can look right while the state is silent, and only a screen reader test finds it.
- There is one thing to update. A script or template that changes the state sets one attribute, instead of a class and an attribute that have to be kept in step.
- Screen readers speak the state in the user's own language. A state attribute such as aria-current needs no extra words in the page, so there is nothing to write, translate or keep hidden.
<a href="/pricing" aria-current="page">Pricing</a>
a[aria-current="page"] { font-weight: bold; }<a href="/pricing" class="active">Pricing</a>
a.active { font-weight: bold; }Guides that rely on it (20)
- Disabled buttons that can't be found or say why
- Filter links that don't say which is chosen or what changed
- Toggle buttons that don't say whether they are pressed
- Autocomplete fields with silent, mouse-only suggestions
- Date pickers that can't be typed in or used by keyboard
- Multi-selects whose ticks are never read out
- Toggle switches that don't say whether they are on
- Expandable table rows a keyboard can't open
- Seat maps keyboards can't use and screen readers can't read
- Tree views keyboards can't open and screen readers flatten
- Show and hide buttons that don't say whether they are open
- Tabs that only work with a mouse
- Step indicators that mark the current step only by its look
- Select-all checkboxes whose dash is never read out
- Breadcrumbs that mark the current page only by its look
- Navigation that marks the current page only by its look
- Pagination links that don't say which page or where they go
- Deep pages with no breadcrumb or highlighted menu section
- Invalid ARIA that misleads screen readers
- Sortable tables that show the sort only as an arrow
Sources
- CSS-Tricks, User Facing State: styling from ARIA state attributes instead of classes (opens in a new tab)
- W3C, Understanding 1.3.1 Info and Relationships: what is shown visually is also available in code (opens in a new tab)
- W3C, WAI-ARIA 1.2: definitions of states and properties (opens in a new tab)
- MDN: attribute selectors (opens in a new tab)
Keep words as text
When words carry information, such as a heading, an offer, a date or a warning, put them on the page as real text styled with CSS, not inside an image; alt text gives screen readers the words, but nobody else can resize, recolour or translate them.
Why
- Readers can change text and can't change a picture. A larger text size, a different font, wider spacing, their own colours or a dark theme all reach real text, and none of them reach the pixels of an image.
- Text stays sharp and fits. It is drawn afresh at every size and wraps to the width of the screen, while an image of text blurs when zoomed and shrinks with the layout on a phone.
- More tools can use it. Browser translation, find in page, copy and paste, reading tools that highlight words as they speak, and search engines all work on text, and skip an image whatever its alt says.
- It is cheaper to keep right. Changing a date or a word is an edit, not a new image from a design tool, so the page and its text alternative never drift apart.
<table>
<tr><th>Size</th><th>Chest</th></tr>
<tr><th>M</th><td>102 cm</td></tr>
</table><img src="size-chart.png" alt="Size M: chest 102 cm…">Guides that rely on it (4)
Sources
- W3C, Understanding 1.4.5 Images of Text (opens in a new tab)
- W3C, Understanding 1.4.9 Images of Text (No Exception): who needs to change how text looks (opens in a new tab)
- W3C WAI, How People with Disabilities Use the Web: visual (customising fonts, colours, spacing and text size) (opens in a new tab)
- W3C technique C22: using CSS to control the visual presentation of text (opens in a new tab)
- MDN: web fonts (opens in a new tab)
Hide things from everyone at once
When something is out of view or out of use, hide it from sight, the keyboard, the pointer and screen readers together, with hidden, display, visibility or inert, not from one of them.
Why
- aria-hidden hides from screen readers only. The element stays in the tab order and can still be clicked, so a keyboard user can land on something a screen reader won't describe, and the person hears nothing, or less than the page shows.
- Moving something off screen, or fading it to nothing, hides it from sight only. Tab still stops on its links and a screen reader still reads them, so people reach things nobody can see.
- One switch covers everything inside. hidden, display: none, visibility: hidden and inert apply to every descendant, including links and fields added later, so there is no tabindex to set and reset on each one.
- The browser keeps it working. These are HTML and CSS that every current browser enforces, with nothing for a script to forget when the content changes.
<!-- The closed menu, out of view -->
<nav id="menu" class="drawer" inert>…</nav><!-- The closed menu, out of view -->
<nav id="menu" class="drawer" aria-hidden="true">…</nav>Guides that rely on it (4)
Sources
- W3C, Using ARIA: the fourth rule, no aria-hidden="true" on a focusable element (opens in a new tab)
- W3C, WAI-ARIA 1.2: aria-hidden, and why it must not be used on anything that can take focus (opens in a new tab)
- W3C ACT rule: element with aria-hidden has no content in sequential focus navigation (opens in a new tab)
- MDN: the inert attribute (opens in a new tab)
- MDN: visibility, which hides an element from the accessibility tree and the tab order (opens in a new tab)
Explain instead of disabling
Leave a button that can't do its job yet working, and when it is pressed, say what is missing next to the cause, rather than greying it out.
Why
- A disabled button says no, but not why. People have to guess which field or box is holding it back, and the guess is hardest for those who see only part of the page or can't see it at all.
- Disabled buttons drop out of the Tab order. A keyboard or screen reader user moving with Tab never lands on them, so they may not know the button exists, let alone that it is waiting for something.
- Disabled buttons are usually drawn faint. Browsers and WCAG let disabled controls have any contrast, so the button and any hint in it are hard to read for people with low vision.
- Pressing gives an answer. An enabled button that shows the error beside the field that caused it tells people exactly what to fix and takes them there, with the same error handling the form needs anyway.
<button type="submit">Place order</button>
<!-- On submit: show "Tick the box to accept the terms" beside the box --><button type="submit" disabled>Place order</button>Guides that rely on it
Sources
- GOV.UK Design System, Button: disabled buttons have poor contrast and can confuse some users, so avoid them (opens in a new tab)
- W3C ARIA Authoring Practices Guide: focusability of disabled controls (opens in a new tab)
- Adam Silver: the problem with disabled buttons and what to do instead (opens in a new tab)
- Smashing Magazine: frustrating design patterns, disabled buttons (opens in a new tab)
Make a gesture a shortcut, never the only way
A right-click, a long press, a swipe, a pinch, a drag or a tilt of the phone can speed up an action, but the same action also needs a control people can see, reach with Tab and press once.
Why
- Gestures are invisible. Nothing on a row says it opens a menu when right-clicked or reveals a Delete button when swiped, so people who don't guess the gesture never find the action.
- The keyboard can't make them. Tab, Enter and Space reach buttons and links, not a pointer held still or moved along a path, so keyboard, switch and voice control users are left with no way in.
- Not everyone can hold or aim a pointer. A long press slips into a scroll for someone with a tremor, and a swipe has to follow a path that a head pointer or a mouth stick can't trace.
- Not every phone moves as its owner means it to. A phone fixed to a wheelchair mount can't be tilted, and one in a shaking hand or on a bus tilts all the time, so an action tied to motion needs a button and a way to switch the motion off.
- Platforms differ. A touch screen has no right-click, iOS Safari fires no context menu event on a long press, and on a Mac only a screen reader command opens one from the keyboard. A button works the same everywhere.
<li>
Invoice March.pdf
<button type="button">Delete</button>
</li>
<!-- A swipe or right-click on the row can delete it too --><li oncontextmenu="openMenu(event)">Invoice March.pdf</li>Guides that rely on it (21)
- Colour pickers you can only drag, with no field to type
- Range sliders that only move by dragging
- Carousels that keyboard and screen reader users can't use
- Expandable table rows a keyboard can't open
- Product photo zoom that needs a mouse
- Product photo thumbnails that need a mouse or say nothing
- Toolbars of clickable icons a keyboard can't reach
- One-time code boxes that won't take a pasted code
- Full-page sections that Page Down and Space can't move
- Signature pads with no way to type a signature
- Dropdown parent links that open the submenu, not the page
- Hover-only dropdowns, or ones that never say they are open
- Right-click, long-press and swipe actions with no button
- Drag-and-drop boards that only a mouse can use
- File upload drop zones with no button to choose files
- Card actions that only appear on hover
- Maps that are the only way to find a location
- Sortable lists that move only by dragging, or in silence
- Resizable panels you can only resize by dragging
- Pinch, drag and tilt gestures with no button
- Chart tooltips a keyboard can't open
Sources
- W3C, WCAG failure F54: using only pointing-device-specific event handlers for a function (opens in a new tab)
- W3C, Understanding WCAG 2.5.1 Pointer Gestures (opens in a new tab)
- Android Developers: give actions that need a drag or a swipe another way in, for TalkBack, Voice Access and Switch Access (opens in a new tab)
- Nielsen Norman Group: contextual menus are hidden, so their commands should be available elsewhere too (opens in a new tab)
- W3C, Understanding WCAG 2.5.4 Motion Actuation: a control for the same action, and a way to turn the motion off (opens in a new tab)
Keep the text alternative beside what it stands for
Put a transcript, a description of a video, the data behind a chart or the places on a map on the same page, right beside what it stands for, rather than on a page of its own.
Why
- Everyone who finds the original finds the text. Nobody has to notice a link, guess what it leads to or land on a separate page with no context, and a screen reader reaches the words straight after the player.
- More tools reach it. Find in page, browser translation, reader views and search engines read the text along with the rest of the page, and people who read along while they listen don't have to switch between two pages.
- It stays in step. When the recording is replaced or the video re-cut, its text is on the same page and gets edited in the same change. A transcript on a page of its own is easy to forget, and a broken or stale link leaves the media with no alternative at all.
- It can still stay out of the way. A long text can sit in a details element under the player, closed until someone opens it, and still be on the page.
<audio controls src="episode-4.mp3"></audio>
<details>
<summary>Transcript</summary>
<p><b>Alex:</b> …</p>
</details><audio controls src="episode-4.mp3"></audio>
…
<footer><a href="/transcripts">Transcripts</a></footer>Guides that rely on it (6)
Sources
- W3C WAI, Making Audio and Video Media Accessible: Transcripts (for media on your own site, it is best to include the transcript on the same page) (opens in a new tab)
- W3C, WCAG technique G158: a transcript published with the audio, linked immediately after it (opens in a new tab)
- W3C WAI, Images Tutorial: Complex Images (show the long description as part of the main content) (opens in a new tab)
Write the source in the order it is read
Put content and controls in the markup in the order people read and use them, and let CSS arrange that order on screen without changing it.
Why
- The markup is the only order most tools see. Screen readers, braille displays, read-aloud tools, the Tab key, reader views and pages printed or copied with styles off all follow it, and none of them follow a float, order, grid placement or row-reverse.
- One order means one experience. When the source and the screen agree, a sighted colleague, a keyboard user and a screen reader user meet the same amount after the same name and the same button first, and can describe the page to each other.
- It survives the next layout. A phone layout, zoom, a user style sheet or a redesign can move things on screen, but a source written in reading order still reads correctly underneath. Order fixed up in CSS has to be fixed again at every breakpoint.
- There is nothing extra to keep in step. Hidden labels, positive tabindex values and other patches that make up for a jumbled source each need updating whenever the content changes, and break silently when one is missed.
<li><span>Canvas tote</span> <span class="amount">$28</span></li>
li { display: flex; justify-content: space-between; }<li><span class="amount">$28</span> Canvas tote</li>
.amount { float: right; }Guides that rely on it (5)
Sources
- W3C, CSS Display Module Level 3: Reordering and Accessibility (order does not affect speech or sequential navigation; authors must use it only for visual reordering) (opens in a new tab)
- W3C, WCAG technique C27: making the DOM order match the visual order (opens in a new tab)
- W3C, WCAG failure F1: changing the meaning of content by positioning information with CSS (opens in a new tab)
- MDN: Ordering flex items (reordering in CSS leaves the reading and Tab order as written in the source) (opens in a new tab)
Write labels and link text that make sense on their own
Give each form field a label, and each link its text, that says what it is for when read by itself, without the heading, the sentence, the picture or the layout around it, because that is how much of the time it is read.
Why
- Links are read in a list. Screen readers can list every link on a page, and Tab moves from link to link, so "click here", or three links all called "Care guide", say nothing about where each one goes, even when the line around each link does.
- Screen readers read the label alone. Moving through a form with Tab, people hear each field's label as it takes focus, and the text between the fields is usually skipped, so a heading or a preview that explains "Name" never reaches them.
- A magnifier shows one field at a time. Under high zoom, the label and its field may be all that is in view, and the heading that gave the label its meaning is off screen.
- The label is reused elsewhere. Error messages, error summaries, review pages and a screen reader's list of form fields all quote it without its surroundings, and "Enter a name" or "Email: required" says nothing about whose.
- Voice control works from the words people see. They say the label to reach a field, so the clearer the visible words, the easier the field is to name, and two fields that share one word can't be told apart.
<label for="name">Recipient's name</label>
<input id="name" name="recipient-name" type="text"><h2>Who it's for</h2>
<label for="name">Name</label>
<input id="name" name="recipient-name" type="text">Guides that rely on it (4)
Sources
- W3C, Understanding WCAG 2.4.6 Headings and Labels: labels that are present must be clear and descriptive (opens in a new tab)
- W3C, Understanding WCAG 2.4.9 Link Purpose (Link Only): links stay clear out of context, such as in a screen reader's list of links (opens in a new tab)
- W3C, WCAG technique G131: providing descriptive labels (opens in a new tab)
- WebAIM, Creating Accessible Forms: labels are announced as fields take focus, and the text between them is usually skipped (opens in a new tab)
- W3C, Understanding WCAG 2.5.3 Label in Name (speech input users speak the visible label) (opens in a new tab)
Read the order back before it is final
Before a step that spends money, signs people up to something, publishes what they wrote or deletes what they made, show them what they chose, in words, with a way to change each part, and only then ask them to confirm.
Why
- Most costly mistakes are valid. Two tickets instead of one, or Saturday instead of Friday, pass every check a form can run, so validation can't catch them; only the person can, and only if they are shown.
- A form is never seen whole. People who zoom in, use a screen reader or fill it in on a phone meet it one field at a time, and a choice made several fields earlier is out of sight by the time they press Pay.
- Stopping a mistake is cheaper than undoing it. A review costs one page, while a refund holds people's money for days, needs a process behind it, and only helps those who notice in time.
- It answers what software misheard or a hand slipped on. Voice input, switches and tremors all produce choices people didn't mean, and a read-back is where they find out.
<h1>Check your booking</h1>
<dl>
<dt>Tickets</dt>
<dd>2 <a href="/book#tickets">Change</a></dd>
</dl>
<button type="submit">Confirm and pay $48</button><input id="tickets" name="tickets" type="number" value="1">
<button type="submit">Pay now</button>Guides that rely on it (5)
Sources
- W3C, WCAG technique G98: providing the ability for the user to review and correct answers before submitting (opens in a new tab)
- GOV.UK Design System, Check answers: let people check their answers, with a link to change each one, before they submit (opens in a new tab)
- Nielsen Norman Group, Preventing user errors: preview results so people can check they will get what they want, and don't rely on a confirmation dialog alone (opens in a new tab)
Open links in the same tab
Let a link open where people already are, in the same tab, and leave opening it elsewhere to them; when a page really needs a new tab, say so in the words of the link.
Why
- Back keeps working. A new tab starts with no history, so in many browsers Back does nothing there, and the way back is a tab that people have to know is there and then find.
- Not everyone sees a tab open. A screen reader reads out the new page, a magnifier shows only the part of the screen it is on, and on a phone the old page waits out of sight in another tab. People think the site has replaced their page, or lost it.
- People can already choose. Desktop browsers open a link in a new tab on a middle click, on Ctrl or Command and a click, or from the context menu, and phone browsers offer it on a long press. A site that forces a new tab takes that choice away from everyone.
- A warning lets people decide. Where a new tab helps, such as help beside a form that is half filled in, words in the link tell everyone before they press it, so they can plan their way back.
<a href="/size-guide">Size guide</a><a href="/size-guide" target="_blank">Size guide</a>Guides that rely on it
Sources
- W3C, WCAG technique G200: opening new windows and tabs from a link only when necessary (opens in a new tab)
- W3C, WCAG technique H83: using the target attribute to open a new window on user request and indicating this in link text (opens in a new tab)
- Nielsen Norman Group, Opening links in new browser windows and tabs: new tabs break the Back button, often go unnoticed, and can open outside a magnified area (opens in a new tab)
- GOV.UK Design System, Links: avoid opening links in a new tab, and when one is needed, put "opens in new tab" in the link text (opens in a new tab)
Say it in words, not only in the styling
When the way text is drawn carries meaning, such as a line through an old price, a word marked as new or a change shown in red and green, write that meaning in words too, beside it, rather than leaving it to the styling.
Why
- Styling isn't read aloud. Screen readers and read-aloud tools speak the text, and a line-through, a colour or a weight set in CSS isn't part of it, so two prices are read as two prices.
- Markup alone depends on the reader. Elements such as s, del and ins do tell assistive technology what the text is, but whether a screen reader says so depends on the screen reader and its settings; a word is read the same in all of them.
- A style has to be known to be understood. A line through a price means "no longer" only to people who know the convention, and a word such as "was" says it outright.
- Not everyone sees the styling either. A colour vision deficiency, glare or a Windows contrast theme takes a red and a green away, and text hidden for screen readers doesn't bring them back to the eye; a word on the screen survives all three.
<p class="price">
Was <span class="old">$40</span>
Now $28
</p><p class="price">
<span class="old">$40</span>
$28
</p>
.old { text-decoration: line-through; }Guides that rely on it (7)
- Status dots told apart by colour alone
- Toggle switches that don't say whether they are on
- Expandable table rows a keyboard can't open
- Required fields marked only by colour
- Icons and images drawn only in CSS, with no text
- Old prices and removed words shown only by a strike-through
- Sortable tables that show the sort only as an arrow
Sources
- W3C, WCAG technique G117: using text to convey information that is conveyed by variations in presentation of text (opens in a new tab)
- W3C, WCAG failure F2: changes in text presentation that convey information without the appropriate markup or text fail 1.3.1 (opens in a new tab)
- W3C, Understanding WCAG 1.3.1 Info and Relationships: information conveyed through presentation has to be available when the presentation changes, such as when it is read aloud (opens in a new tab)
- W3C, Understanding WCAG 1.4.1 Use of Color: colour must not be the only visual means of conveying information, and the alternative has to be visible, even when assistive technology already gets it (opens in a new tab)
- W3C, WCAG technique G14: information conveyed by colour differences is also available in text (opens in a new tab)
Convert what people type instead of rejecting it
When a value is right but written in a different form from the one you store, such as digits typed at full width or a number with spaces in it, convert it yourself rather than asking the person to type it again.
Why
- The value is already right. A phone number in full-width digits or with hyphens is the same number, and an error makes a correct answer look wrong.
- The difference is easy to miss. Full-width and half-width digits differ mainly in the space each takes, so a person told the number is invalid looks at their digits and finds nothing to fix.
- One line of code saves everyone a retype. Converting is done once, in one place, and a rejection costs every person who meets it another try, more for those who type slowly or with an input method.
- Checking still happens. The converted value is checked as before, on the page and on the server, so a value that is really wrong is still refused, with a message that says what to change.
const digits = tel.value.normalize('NFKC').replace(/[\s\-‐−ー]/g, '');
const valid = /^[0-9]{10,11}$/.test(digits);const valid = /^[0-9]{10,11}$/.test(tel.value);
// "Enter a valid phone number."Guides that rely on it
Sources
- GOV.UK Design System, Telephone numbers: let users enter telephone numbers in whatever format is familiar to them, and allow additional spaces, hyphens, dashes and brackets (opens in a new tab)
- GOV.UK Design System, Text input: a strict maximum length stops people formatting information in their usual way, voice control may add spaces, and a value should be called too long only after normalisation (opens in a new tab)
- W3C, Understanding WCAG 3.3.3 Error Suggestion: people with cognitive limitations may find it hard to understand how to correct an error, and people with visual disabilities may not be able to work out exactly how to correct it (opens in a new tab)
Change the page only when people ask
Take people to another page, open a pop-up over what they are doing, close what they are using, load more, start sound or end their session only when they press something that says it will, such as Apply, Play, Load more or Close, not on a timer, when a value changes or when focus moves; where a time limit has to stay, warn people before it ends and let one press extend it.
Why
- A change people didn’t cause is easy to miss. A screen reader or magnifier user picking an option, tabbing through a panel or reading a confirmation is not watching the rest of the screen, so a new page, a closed panel or a list that grew ahead of them leaves them somewhere they didn’t choose, with nothing to say how they got there. W3C names people with low vision, people with motor impairments and people with some cognitive disabilities among those these changes confuse.
- Passing through is not choosing. On a keyboard, the arrow keys step through a menu’s options one value at a time, and Tab passes through a panel on the way to its results. A page that acts on each new value or each move of focus acts on choices people were only passing.
- A timer is a deadline nobody agreed to. Reading, typing or moving more slowly, or stopping to do something else, is enough to miss it, and a page that moves on or signs people out takes away what they were reading or had entered.
- Sound the page starts competes with the screen reader. People who hear the page through speech find it hard to follow that speech over a soundtrack, often on the same volume control, and the way to stop it is something they have to find by listening.
- A button says what will happen before it happens. Apply, Load more or Keep me signed in tells people what pressing it does, reaches the keyboard, screen readers and voice control alike, and makes the change when people are ready, where they expect it.
- When a limit has to stay, a warning is the next best thing to asking. A message people meet at once, before time runs out, with one press to extend it, gives the choice back to them, and WCAG asks for at least 20 seconds to make it.
<label for="sort">Sort by</label>
<select id="sort" name="sort">…</select>
<button type="submit">Apply</button><label for="sort">Sort by</label>
<select id="sort" name="sort" onchange="this.form.submit()">…</select>Guides that rely on it (11)
- Infinite scroll that moves the footer away as Tab nears it
- Search panels that close on Tab and drop keyboard focus
- Timed pop-ups that open while you read or type
- Toasts that vanish before you can read or undo them
- Autoplaying sound with no way to stop it
- Auto-updating feeds that change while people read them
- Dropdowns and fields that change the page on their own
- Pop-up windows that open as soon as a page loads
- Checkout timers that release held seats
- Pages that reload or redirect themselves on a timer
- Session timeouts with no warning or way to extend
Sources
- W3C, Understanding 3.2.5 Change on Request: changes of context start only when people ask, such as an Update now button in place of automatic updates (opens in a new tab)
- W3C technique G76: providing a mechanism to request an update of the content instead of updating automatically (opens in a new tab)
- W3C, Understanding 3.2.2 On Input (opens in a new tab)
- W3C, Understanding 2.2.1 Timing Adjustable: turn a limit off, adjust it, or warn and give at least 20 seconds to extend it (opens in a new tab)
- W3C, Understanding 1.4.2 Audio Control: screen reader users find it hard to hear their speech output over other audio (opens in a new tab)
- W3C, Understanding 2.2.4 Interruptions: people can postpone or suppress interruptions, so that people with attention deficit disorders can focus on content without distraction (opens in a new tab)
Name things by pointing at the words on screen
When the words that name a control, a region or a table are already shown, such as a field’s label or a section’s heading, make that text its name, with a label element, a caption or aria-labelledby, rather than writing the same words again in aria-label.
Why
- There is one copy of the words. Reword or translate the label, and the name changes with it. A second copy in aria-label is invisible on screen, so nobody notices when the two drift apart, and W3C notes that hidden names are more likely to go out of date.
- Everyone gets the same words. A screen reader reads the label people see, and voice control acts when someone says "Click" and that label, which WCAG 2.5.3 asks for. A copy that lacks one of the label’s words already breaks the second.
- It shows in review. A label element or an aria-labelledby id points at text you can see in the markup and on the page; a copied aria-label has to be compared by hand with what the page shows.
<div id="message-label">Message</div>
<div role="textbox" contenteditable="true" aria-labelledby="message-label"></div><div>Message</div>
<div role="textbox" contenteditable="true" aria-label="Message"></div>Guides that rely on it (9)
- Banner and image links with no name
- Buttons and links named differently from their text
- Smiley-face ratings announced only as "button"
- Rich text editors announced without their label
- Radio buttons and checkboxes without a group name
- Form fields with missing or mismatched labels
- Progress bars and meters that screen readers can't read
- Navigation landmarks that all sound the same
- Tables with a title but no caption
Sources
- W3C ARIA Authoring Practices Guide, Providing Accessible Names and Descriptions: Prefer Visible Text (simpler upkeep and translation; hidden names are more likely to go out of date) (opens in a new tab)
- W3C, Understanding WCAG 2.5.3 Label in Name (speech input users speak the visible label) (opens in a new tab)
- W3C technique ARIA16: using aria-labelledby to provide a name for user interface controls (opens in a new tab)
Explain a word where it is used
When a page uses a word its readers may not know, such as a trade term, an abbreviation or an idiom, write what it means on the page right beside it, in brackets or in the same sentence, rather than leaving it to a tooltip, a glossary or a help page.
Why
- People don't look up a word they think they know. A trade term often looks like an everyday word ("excess", "mode"), so readers take the everyday meaning and never think to ask; W3C tells of someone with dementia who could not use a heating unit because one menu said "mode".
- It reaches everyone. Words on the page are read by a keyboard user, on a touch screen and by a screen reader alike, while a tooltip shown on hover needs a mouse, which the HTML standard warns leaves out keyboard and touch users.
- It stays in view. People who zoom in see a small part of the page at a time, and a meaning beside the word is in that part; one at the foot of the page or on another page takes them away from the sentence they were reading.
<p>Excess (the most you pay towards damage): 1,000.00</p><p><span title="The most you pay towards damage">Excess</span>: 1,000.00</p>Guides that rely on it (4)
Sources
- W3C, Making Content Usable for People with Cognitive and Learning Disabilities: Use Clear Words (explain jargon, for example a simple term in brackets next to it; the "mode" example) (opens in a new tab)
- HTML Standard, the title attribute: relying on it is discouraged, since many browsers need a pointing device to show it, which excludes keyboard-only and touch-only users (opens in a new tab)
- W3C, Understanding 3.1.3 Unusual Words: helps people who lose visual context when zoomed in with a screen magnifier (opens in a new tab)
- W3C technique G112: using inline definitions, in the text right before or after the word (opens in a new tab)