In web design, a hamburger menu is a button — usually with three horizontal lines — that typically opens a navigation menu. The icon vaguely resembles a hamburger (or any other sandwich), hence the name.
Like many trends in web design, hamburger menus are controversial: They can cause accessibility issues, depending on their implementation, and they might obscure important navigational information. However, they’re extremely common — and while they pose a few potential issues for users with disabilities, sidebars can be accessible with appropriate markup.
In 2014, Mike Stern, Apple’s user experience (UX) evangelist, called hamburger menus “tedious" and encouraged developers to avoid them:
“Remember, the three key things about an intuitive navigation system is that they tell you where you are, and they show you where else you can go. Hamburger menus are terrible at both of those things, because the menu is not on the screen. It’s not visible. Only the button to display the menu is.”
Of course, Apple’s own website uses a hamburger menu on its mobile view (albeit with two lines instead of the traditional three). And since 2014, hamburger menus have spread to virtually every corner of the internet — including the Bureau of Internet Accessibility’s website.
As a design element, hamburgers have some serious advantages:
The bottom line: Hamburger menus are useful, and they’re probably here to stay. And while they require more work than a traditional list of links, hamburger menus can be implemented without creating usability issues or accessibility barriers.
Hamburger menus are almost always used for mobile navigation — not as a primary navigation control for larger viewports (such as desktop browsers). That’s because the purpose of the menu is to save screen real estate. If you don’t have a shortage of real estate, a traditional menu is a better choice.
To create an accessible hamburger menu, follow these four tips:
Native semantic HTML keeps your website organized in a logical way and ensures that your content works with a wide variety of user agents. That generally means using <button> or <a>, depending on the purpose and contents of the hamburger menu.
Since your hamburger menu is dynamic, you may need additional markup to define its semantics — that means using WAI-ARIA.
Related: Plain Old Semantic HTML: A Perfect Basis for Accessibility
WAI-ARIA (Web Accessibility Initiative - Accessible Rich Internet Applications) provides semantic information that can’t be communicated through native HTML. Hamburger menus usually require some ARIA:
Remember, by using ARIA, you’re making a commitment to test your work! Navigation menus are particularly important for users, so review your markup carefully. Misused ARIA can create serious accessibility barriers, so work with an accessibility expert to avoid issues.
Related: 5 Tips for Using ARIA to Improve Web Accessibility
Hamburger menus allow you to hide long lists of links — and if you know that the links aren’t taking up real estate, you may be tempted to keep adding to that list.
That’s not a great practice: Navigation menus should include links to important pages, but if you’re serving dozens of hyperlinks to your users, they might not be able to find what they need.
Before adding a new link, consider whether it actually improves navigation or whether you could nest the link in another section of your website.
Related: The Most Common Web Accessibility Issues to Avoid
Make sure your menu can be operated with a keyboard alone (no mouse) using basic controls:
Keyboard accessibility is fundamental, so don’t skip this step. For more detailed guidance, developer Ashley Sheridan has an excellent article about building a basic accessible hamburger menu with minimal JavaScript.
Related: What is Keyboard Accessibility?
By thinking about users with disabilities, you can create robust content that functions as intended — and when you’re thinking about adding a new feature (such as a hamburger menu), you can make important decisions with confidence.
The Bureau of Internet Accessibility can help you build the best practices of accessibility into your web development process. To get started, send us a message to connect with a subject matter expert.