Accordions are everywhere, and many of them are hard to use without a mouse. An accessible accordion works for keyboard users, screen reader users and people who prefer less motion, without extra effort from them. This checklist follows WCAG 2.2 and the accordion pattern in the WAI-ARIA Authoring Practices.
1. Use a real button for each header
The header must be a focusable control. A button element is the right choice: it receives focus, responds to Enter and Space, and is announced as a button. Clickable div elements without roles or keyboard handling fail people who don’t use a mouse.

2. Wrap the button in a heading
Placing the button inside a heading element (for example an h3) keeps the page outline intact. Screen reader users often jump between headings to find what they need.
3. Expose the open state
Each header button needs aria-expanded="true" when its panel is open and "false" when closed. Without it, a screen reader user can’t tell what happened after pressing the button.
4. Connect the header and the panel
Give the panel an id and point to it from the button with aria-controls. Give the panel role="region" and label it with aria-labelledby pointing to the header, so it is announced with its title.
5. Support the expected keys
| Key | Expected behaviour |
|---|---|
| Enter or Space | Opens or closes the focused panel |
| Tab | Moves to the next focusable element |
| Down / Up arrow | Moves to the next or previous header (optional but helpful) |
| Home / End | Moves to the first or last header (optional) |
6. Make focus visible
Keyboard users must see where they are. Never remove the focus outline without replacing it with a clear focus style that meets contrast requirements.
7. Keep IDs unique
When a page has several accordions, every header and panel ID must be unique. Duplicate IDs make screen readers announce the wrong panel.
8. Respect reduced motion
Some people experience discomfort with motion. Honour the prefers-reduced-motion setting by skipping or shortening the opening animation.
9. Don’t hide content from assistive technology permanently
Closed panels should be hidden from everyone until opened, and fully available once opened. Content should also remain readable if JavaScript fails, rather than being permanently invisible.
10. Check colour contrast
Header text, icons and focus styles need enough contrast against their background, in every state: normal, hover and open.
11. Test with real tools
- Navigate the page with only the keyboard.
- Try a screen reader: VoiceOver on macOS and iOS, NVDA on Windows, TalkBack on Android.
- Turn on reduced motion in your system settings and reload.
- Run an automated checker such as Lighthouse or axe. It finds issues such as missing labels, but does not replace manual testing.
How Easy Accordion Block builds an accessible accordion
Easy Accordion Block builds these requirements in, so you don’t have to add them by hand:
- Headers are real buttons with
aria-expandedandaria-controls, and panels are labelled regions. - Up, Down, Home and End move between headers; Enter and Space toggle.
- IDs stay unique, even with several accordions on one page.
- Reduced motion is respected, panels stay readable without JavaScript, and every panel opens when the page is printed.
You can read the details in the accessibility section of the docs.
What the markup looks like
Here is a simplified example of an accessible accordion item. Easy Accordion Block generates markup along these lines for you:
<h3>
<button type="button" aria-expanded="false" aria-controls="faq-1-panel" id="faq-1-header">
Can I return an item?
</button>
</h3>
<div id="faq-1-panel" role="region" aria-labelledby="faq-1-header" hidden>
<p>Yes, within 30 days.</p>
</div>
When the button is activated, the script sets aria-expanded="true" and shows the panel.
Common accessibility mistakes
| Mistake | Who it affects | Fix |
|---|---|---|
| Header is a div or span | Keyboard and screen reader users | Use a button element |
| No aria-expanded | Screen reader users | Toggle aria-expanded on open and close |
| Focus outline removed | Keyboard users | Add a visible focus style |
| Duplicate IDs | Screen reader users | Generate unique IDs per accordion |
| Long animations, no reduced motion | People with vestibular disorders | Honour prefers-reduced-motion |
| Low-contrast icons | People with low vision | Check contrast in every state |
| Content invisible without JavaScript | Everyone if scripts fail | Keep panels readable without JS |
Frequently asked questions
Is the HTML details element accessible?
The details and summary elements are reasonably accessible out of the box, and work without JavaScript. They lack grouped behaviour and arrow-key navigation between items, which a full accordion can provide. We compare them in the next post.
Do accordions meet WCAG?
An accordion can meet WCAG 2.2 when it uses proper buttons, states, focus styles and contrast, and when it works with a keyboard.
What heading level should accordion titles use?
Use the next level below the section heading the accordion sits in, often H3. Easy Accordion Block lets you choose H2 to H6.



Leave a Reply
You must be logged in to post a comment.