Disclosure Widgets vs True Menus
You'll learn: When to use a simple show/hide disclosure widget versus full menu semantics for accessible dropdown interactions.
The Core Difference
Not every expandable element needs full menu semantics. A disclosure widget is simply content that toggles visibility—think FAQ accordions or "Show more" buttons. A true menu (menu role with menuitem children) is specifically for navigation or application commands with complex keyboard navigation.
The key differentiator is purpose and interaction:
- Disclosure widgets reveal/hide content using
aria-expandedon a button - True menus provide actionable choices with arrow key navigation, type-ahead, and roving tabindex
When to Use Each
Use a disclosure widget when:
- You're simply showing/hiding static content
- Users click once to reveal, then read or interact with normal content inside
- Example: "Show filters" button that reveals filter checkboxes
<button aria-expanded="false" aria-controls="filters">
Show Filters
</button>
<div id="filters" hidden>
<!-- Regular form controls here -->
</div>
Use a true menu when:
- You're providing a list of navigation links or commands
- Users need arrow key navigation between items
- Example: Account dropdown with "Profile," "Settings," "Logout" options
The Mental Model
Think of it like a folding box (disclosure) versus a restaurant menu (true menu). You open a box to see what's inside and then interact with those items naturally. With a restaurant menu, you navigate through organized choices to select one action.
Using the wrong pattern creates confusion—screen reader users expect menus to behave with specific keyboard shortcuts. Don't add menu complexity when a simple button with aria-expanded will do.
Key Takeaway: Use aria-expanded disclosure widgets for simple show/hide content; reserve full menu semantics (menu role) for navigation lists and command menus that need specialized keyboard interaction.