Menu, Menubar, and the Menu Button
Implement app menus with correct roles and keys.
Menu, Menubar, and the Menu Button is a free Web Accessibility Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Web Accessibility Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
What ARIA Menus Are
An ARIA menu is an app-style list of commands, like the File or Edit menus in desktop software, not your site's main navigation. 🍔
Not for Site Navigation
Page links belong in a nav with normal anchors. Use the menu role only for true command sets, or you will confuse screen reader users.
Three Core Roles
The pattern uses role="menu" for the container, role="menuitem" for each command, and role="menubar" for a horizontal always-visible bar.
<ul role="menu">
<li role="menuitem">Cut</li>
<li role="menuitem">Copy</li>
</ul>The Menu Button
A menu button is a real button that opens a menu. Give it aria-haspopup="true" so users know a popup is coming.
<button aria-haspopup="true"
aria-expanded="false">Actions</button>Track Open State
The menu button toggles aria-expanded between true and false as its menu opens and closes, just like any disclosure control.
Move Focus on Open
When the menu opens, move focus into it, onto the first menu item. The button no longer holds focus while the menu is active.
Arrow Keys Inside
Inside a vertical menu, Up and Down Arrow move between items. In a menubar, Left and Right Arrow move along the top-level bar.
Roving tabindex
Only one menu item is in the tab order at a time. With roving tabindex, the focused item has tabindex 0 and the rest have -1.
Activate and Close
Enter or Space runs the focused command and closes the menu. The menu should dismiss itself after a command is chosen.
Escape Returns Focus
Escape closes the menu without acting and sends focus back to the menu button, so the user lands exactly where they started.
Submenus Need More
A flyout submenu uses aria-haspopup on its parent menuitem, and Right Arrow opens it while Left Arrow closes it and returns.
Quick Check
You add a button that opens a list of commands. What signals to assistive tech that a menu will appear?
Recap
Menus are for commands, not page links: open with a haspopup button, move focus in, navigate with arrows and roving tabindex, and let Escape return focus. ✅
Frequently asked questions
Is the “Menu, Menubar, and the Menu Button” lesson free?
Yes — the full text of “Menu, Menubar, and the Menu Button” is free to read here on the web, and the Web Accessibility Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Web Accessibility Academy course, upgrade to CoddyKit PRO.
What will I learn in “Menu, Menubar, and the Menu Button”?
Implement app menus with correct roles and keys. You practise Web Accessibility Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Web Accessibility Academy?
No prior experience is required. Web Accessibility Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Menu, Menubar, and the Menu Button” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Web Accessibility Academy lesson?
Yes. Every Web Accessibility Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Reading the APG: Pattern, Keys, and Examples
- Combobox and Autocomplete Done Right
- Menu, Menubar, and the Menu Button
- Treegrid and Other Advanced Patterns