Accessible navigation and mega menus
Build site navigation as a list of ordinary links inside a nav element. Open each dropdown or mega menu with a real button that says whether it is expanded, not on hover alone, and let Escape close it and return focus to that button. Do not use role="menu" for website navigation. Add a skip link, mark the current page, keep the menu in the same order on every page, and make sure the mobile menu works like a dialog.37
Menus are where many stores lose keyboard and screen reader users before they reach a single product. In WebAIM's 2024 survey of screen reader users, "interactive elements such as menus, tabs and dialogs do not behave as expected" ranked second among the most problematic items on the web, after CAPTCHA; "too many links or navigation items" was also on the list.12
Structure: links in a list, inside nav
W3C's menus tutorial asks for markup that reflects the menu's structure and labels it, and clear, familiar visual states such as the current page.1 Shopify's theme guidance is specific: wrap navigation in nav, use aria-current for the current page, and do not use role="menu" or role="menuitem" for site navigation.7
Why not role="menu"? The ARIA Authoring Practices explain that the menu role brings the expectations of a desktop application menu, with arrow-key navigation and other behaviour that ordinary site navigation does not need. Using it on a list of links can mislead screen reader users. Their navigation example uses the disclosure pattern instead.3
Dropdowns and mega menus: the disclosure pattern
A dropdown or mega menu is a set of links hidden until a button shows them. The ARIA example navigation menu works like this:3
| Key or attribute | Behaviour |
|---|---|
| Tab / Shift+Tab | Moves between the top-level buttons and, when a dropdown is open, through its links |
| Enter or Space on a button | Opens or closes its dropdown |
| Escape | Closes the open dropdown and returns focus to its button |
| Arrow keys, Home, End | Optional extras that move between items; they add to Tab, they do not replace it |
aria-expanded | "true" when the dropdown is open, "false" when closed |
aria-controls | Points from the button to the container it shows or hides |
aria-current="page" | On the link to the page being shown, one at a time |
Shopify's theme guidance matches it: Enter and Space open the menu, focus stays on the button and Tab moves into the first item, and Escape closes it and returns focus to the button.7 Shopify Theme Store themes must also make dropdown navigation keyboard accessible.8
When the top-level item is also a link
Many stores want "Women" to go to a women's collection page and also open a dropdown. W3C's fly-out menu tutorial covers this: add a separate button next to the link, with a hidden label such as "Show Women submenu", that opens and closes the submenu. If the top-level item only summarises its submenu, the item itself can be the button.2 It also advises that submenus should not open just because someone tabs past, so keyboard users are not forced through every link.2
Hover menus
Opening on hover is fine as long as it is not the only way. When a menu appears on hover or focus, WCAG 1.4.13 (level AA) asks that it can be dismissed without moving the pointer, for example with Escape; that the pointer can move onto it without it closing; and that it stays open until dismissed or the pointer leaves.4 W3C's fly-out tutorial suggests a short delay before closing when the pointer leaves, and uses one second in its example, which helps people with less precise mouse control.2
Mega menus need extra care
- Headings inside the panel. If a mega menu groups links under "Shoes", "Bags" and "Accessories", mark those as headings or group labels so a screen reader user hears the structure.
- Images with purpose. A promotional image in a mega menu that is a link needs alt text saying where it goes; one that only decorates needs empty alt text.
- Not too many links. Every link in an open mega menu is a Tab stop. Keep panels closed until asked for, and keep them focused.
- Other routes. W3C notes that fly-out menus can be hard for people with reduced dexterity and suggests also providing the submenu links elsewhere, such as on the parent page.2
Mobile menus
On phones, most themes put navigation in a drawer that slides over the page. If it covers the page and blocks interaction with it, treat it as a modal dialog: focus moves into the drawer when it opens, Tab stays inside, Escape closes it, and focus returns to the menu button.10 Shopify's guidance for theme drawers says the same.7 The menu button needs a name, such as "Menu", and should say whether it is expanded. Nested levels inside the drawer follow the same disclosure pattern as on desktop.
Keep the buttons big enough to tap. WCAG 2.2's 2.5.8 Target Size asks for at least 24 by 24 CSS pixels, or enough space around smaller targets.9
The rest of the header
- Skip link. WCAG 2.4.1 asks for a way to bypass blocks repeated on every page; a link at the top that goes straight to the main content is the usual technique.5 Shopify's guidance is to make it visible when focused.7
- Same order on every page. WCAG 3.2.3 (level AA) asks that navigation repeated across pages appears in the same relative order each time.6
- Sticky headers. A header that stays at the top of the screen must not completely hide whatever has keyboard focus as people tab down the page, which fails 2.4.11 Focus Not Obscured (Minimum). W3C lists CSS
scroll-paddingas a fix.11 - Icon links. Search, account and cart icons need names, ideally including the cart count: "Cart, 2 items".
Test your menu in five minutes
- Tab from the address bar. Is the first stop a skip link?
- Tab to a top-level item with a dropdown. Can you open it with Enter or Space, tab through its links, and close it with Escape, landing back on the button?
- Tab past a closed dropdown. Do you skip over its links?
- With a screen reader, listen to a dropdown button. Does it say "collapsed" or "expanded"?
- On a phone or narrow window, open the mobile menu, move through it, and close it without touching the page behind.
- Run an automated check. Jralo's free check catches links and buttons with no name and other WCAG 2.2 A and AA failures on your homepage and up to five linked pages, and points to the countries whose accessibility laws are likely relevant to your site. Whether a menu opens, closes and returns focus properly needs a person; automated testing finds many problems, not all.
The menu is usually one template shared by every page, so a fix there improves the whole site. For a safe way to change it, see fixing accessibility without breaking your theme, and for the full keyboard pass, how to test with only a keyboard in 10 minutes.
Questions people ask
Should I use role="menu" for my website navigation?
No. The menu role is for application-style menus and tells screen readers to expect arrow-key behaviour that site navigation does not have. W3C's ARIA examples and Shopify's theme guidance both use plain links in a nav element, with buttons that show and hide dropdowns.
Can my dropdown menu open on hover?
Yes, as long as hover is not the only way. Keyboard users need a button to open it. Under WCAG 1.4.13, content that appears on hover or focus must be dismissible without moving the pointer, stay open while the pointer moves onto it, and remain until dismissed.
What should happen when a top-level menu item is also a link?
Keep the link and add a separate button beside it that opens and closes the submenu, with a hidden label such as Show Women submenu and aria-expanded to report its state. That way the link still goes to its page and keyboard users can reach the submenu.
Check your site now
Jralo's free check tests your homepage and up to five pages for accessibility (WCAG 2.2 A and AA) and website QA problems, and tells you which countries' accessibility laws are likely relevant to you. No sign-up.
Run the free checkSources
Every number and legal statement in this post links to one of these sources, read on 13 October 2026.
- W3C WAI: Menus Tutorial
- W3C WAI: Menus Tutorial, Fly-out Menus
- W3C WAI-ARIA Authoring Practices: Example disclosure navigation menu
- W3C WAI: Understanding Success Criterion 1.4.13 Content on Hover or Focus
- W3C WAI: Understanding Success Criterion 2.4.1 Bypass Blocks
- W3C WAI: Understanding Success Criterion 3.2.3 Consistent Navigation
- Shopify: Accessibility best practices for Shopify themes
- Shopify: Theme Store requirements
- W3C: Web Content Accessibility Guidelines (WCAG) 2.2
- W3C WAI-ARIA Authoring Practices: Dialog (Modal) pattern
- W3C WAI: Understanding Success Criterion 2.4.11 Focus Not Obscured (Minimum)
- WebAIM: Screen Reader User Survey #10 results (2024)
More questions
- Why does heading structure matter for screen reader users?
- Visible focus: why removing outlines hurts, and what WCAG 2.2 asks
- Accessible product image galleries, sliders and carousels
- How to make a Shopify cart drawer accessible
- Accessible Shopify variant pickers and colour swatches
- The European Accessibility Act: a step-by-step plan for small online sellers
- ADA Title III and websites in plain English
- What to put in an accessibility statement
- How to make a WooCommerce store accessible
- How to fix accessibility issues without breaking your theme
- How to make a Shopify theme accessible: settings, apps and what to check
- Captions, transcripts and audio description for product and marketing video
- What a screen reader user hears on your product page, and how to fix it
- Accessible forms and checkout: labels, errors and autocomplete
- How to test your website with only a keyboard in 10 minutes
- Colour contrast explained: what WCAG asks and how to fix brand colours
- Why automated accessibility testing finds some problems but not all
- How do I write alt text that actually helps?
- What did WCAG 2.2 add to WCAG 2.1?
- How can I prove my website is monitored for accessibility?
- Does the European Accessibility Act apply to my online store?
- Do accessibility widgets make a website ADA compliant?
- Got an ADA website demand letter? What to do first
- How do I check if my website is accessible? A 15-minute method
- Website accessibility laws by country (2026)