Mega menu

All the sections of a top-level category visible at a glance in an expandable type menu.

UsageOverview

A mega menu is often used as a method for desktop navigation on e-commerce sites or for applications with large product/section ranges.

The use of this component presents usability challenges like responsiveness, accessibility, and cognitive load that should be avoided unless absolutely necessary.

Questions to ask before considering a mega menu:

Consider the following recommendations for a mega menu:


Anatomy
  1. Trigger and dismiss menu item
  2. Top-level title
  3. Group title
  4. Group link item
  5. Link item hover
  6. Link item focused

Variations

The mega menu layout may be tailored to each top-level section. You may choose a different layout for one section compared to another. Some sections may have a varying number of items that can benefit from adding images or including a specific call to action. Organize your menu in any way that optimizes organization and scannability.

Use the grid system to create the layout that best accommodates your data.


BehaviorTrigger & Dismissal

The mega menu should always be triggered by a top-level item in the main header navigation and always following a simple mouse click or tap.

The menu is dismissed by clicking or tapping on the trigger or by clicking or tapping outside of its container.

Keyboard Navigation

After triggering the mega menu, the focus should stay on the triggering item, from there you may implement the following keys to navigate through the menu.

Key Action
TAB + DOWN ARROW Change focus to the next group item in the order
UP ARROW Changes focus on the previous group item in the order
RIGHT ARROW Changes focus to the next group title
LEFT ARROW Changes focus to the previous group title
ENTER Navigate to the focused link
ESC Collapse the mega menu
Links

All links listed in a mega menu component should be site-level links as opposed to page-level links.


Order & AlignmentHierarchy

As part of the top header navigation, the mega menu should have the top index position on the page superseded only by overlay elements such as modals, overlay sidebars, and drawers.

Spacing

The mega menu may occupy up to half the height of the page or expand to full height if deemed necessary to properly fit its contents. Under no circumstances should the user have to scroll the mega menu to reach navigation items.

Overflow RulesTruncate

Truncation of any group title or group link item is not recommended. Use concise descriptive labels for each group title and link item on your menu.

Scrolling

Scrolling on the mega menu container is not recommended.


Best PracticesAccessibility

Mega menus can cause accessibility issues with screen readers, especially for users with low vision who see a screen zoom tool to view your website. For this reason, it is recommended that you simplify accessibility to your site sections by making each top-level menu choice clickable, leading to a regular page where you present all the mega menu options in plain, fully accessible HTML.

Consider the following for accessibility:

Responsiveness

Mega menus are considered a good option for desktop sites but are often inappropriate on mobile devices. Many times they don't display correctly because of rendering issues and, on other occasions, they simply take up too much screen real state to be useful.

Consider the following guidelines for responsiveness:

Mobile mega menu

Mobile mega menu behavior


Feedback

We would like to get your feedback. Tell us how you use this component in your projects and how we can improve it.

Style

HTML/CSS v2ExamplesLists of navigation items
Mixed