Website elementsControls & details
Menu button
A menu button, built into your site with no plugin and no library. The WAI-ARIA menu button: a <button aria-haspopup="menu"> that opens a role="menu" of links or actions (or a radio menu for a setting), with arrow keys, Home/End, type-ahead, Escape back to the button, click-outside to close, and a flip upward when there is no room below. Without JavaScript it is a <details> holding the same links.
Choose something from a menu.
Tuck a handful of actions — share, export, edit, delete — behind one tidy button that works the same with a mouse, a keyboard or a screen reader.
Also called
dropdown buttonaction menukebab menuthree-dot menumore options menuBootstrap dropdown
What it replaces
- Bootstrap’s dropdown component
- page-builder “dropdown button” modules
- hand-rolled hover dropdowns that a keyboard cannot open
Good for
A few actions that do not each deserve a button: Share, Export, Download as…, the ⋮ on a card or a table row, a Sort by or View as setting on a listing.
Not for
Site navigation: a header of pages is a list of links, and role="menu" makes a screen reader expect application keys; use mega-menu (or plain header links). Choosing a value in a form: that is a native <select>, or radio-group when the options deserve to be seen. And more than about ten items, which is a page, not a menu.
Accessibility
Written so the page works for every visitor, whether they browse with a mouse, a keyboard or a screen reader, and whether or not they have asked for less motion.
- The WAI-ARIA Authoring Practices menu button: the button has aria-haspopup="menu", aria-expanded and aria-controls; the menu is role="menu", labeled by the button, and its items are role="menuitem" (or "menuitemradio" with aria-checked) with tabindex="-1", so the menu is one Tab stop.
- On the button, Enter, Space and ↓ open the menu on the first item (the checked one in a radio menu) and ↑ opens it on the last. In the menu, ↓ ↑ move and wrap, Home and End jump, a letter moves to the next item starting with it, Enter and Space activate, Escape closes and returns focus to the button, Tab closes and moves on.
- A click outside or focus leaving the element closes the menu. A disabled item is aria-disabled: reachable and announced, not activatable.
- The menu opens below the button, or above it when the room below is short and there is more above, measured each time it opens; it never runs off the side of the viewport.
- Buttons and items are at least 44px tall; the icon-only button is 44px square with its full label as aria-label.
- prefers-reduced-motion: the menu appears without its 120 ms fade.
- Without JavaScript it is a <details>: the summary shows the same label and opens the same list, and link items work. No menu roles are rendered until the script can honor them.
Where it's live
- superherotech.ai: /elements/menu-button/ (demo)
How to ask for it
“The menu-button on our home page, with …”
Name it, say which page and which part of the page it goes on, and say what goes in it: your photos, your words, your colors. That is a complete request. We build it, you approve it, and it goes live. If you know it by another name, from WordPress or from another site, that works too.
More elements you can ask for: Before / After, Particle field, Mega menu, Video background, Parallax band, Scroll reveal, Business hours, News ticker, Flip box, Instagram feed, Accordion / FAQ, Card slider, Tabs, Info list, Video player, Testimonial carousel, Icon library, Animated text, Cookie consent, Animated background, Modal box, Announcement bar, Image hotspots, Info circle, Slide box, Countdown, Content toggle, Off-canvas panel, Video gallery, Map and directions, Link effects, Tabcordion, Tooltip, Responsive table, Notice, Toast, Loading, Radio group, Stepper, Tags, Scrollbox, Sticker. Or see all of them working.
More in Controls & details
See them all working- Radio group
Let people pick one option at a glance — as a list, as big cards with an icon, or as a pill switch — and it still posts like the plain form it is.
- Tags
Show the topics, features or filters that belong to something, and let visitors clear a filter with one tap.
- Cookie consent
A consent bar that is yours: no monthly CMP fee, nothing loads from Google until the visitor has said yes where the law needs a yes.
- Link effects
Links that answer back when you point at them, and never leave a keyboard user or a slow eye behind.
Want the menu button on your site?
Tell us about the business. We build the site with it, launch it, and change it whenever you ask.