Sub topic 3
Choosing a primary navigation pattern
This chapter assumes you know basic HTML and CSS, can build lists of links, and understand the box model. You already have a draft site structure and clear labels from the earlier chapters. Here you pick the pattern that presents them.
What the choice depends on
A primary navigation pattern is the way a site shows its top-level links. The right pattern depends on three things:
- Number of top-level items. Count the sections your user tasks need.
- Depth. Do those sections have child pages that users need to reach quickly?
- Screen space. A pattern that fits a desktop header may not fit a phone.
Pick the simplest pattern that gets users to their tasks. Each step up in complexity adds code, ARIA state, and testing.
The three common patterns
| Pattern | Best for | Typical size | Main cost |
|---|---|---|---|
| Simple menu | Small sites, flat structure | 3 to 7 links | Little. Plain links in a list |
| Dropdown | Sections with a few children each | 5 to 8 top items, 3 to 8 children each | Needs a disclosure button and keyboard handling |
| Mega menu | Large catalogs or documentation with grouped children | Many children under a few top items | Layout, grouping, and the most accessibility work |
Simple menu
A simple menu is a single row of links. Every destination is one click away, and there is no hidden content. It works well for a portfolio, a local business, or a small product site. If your information architecture is flat, stop here.
Dropdown
A dropdown shows a short list of child links under a top-level item. Use it when a section has a few children that users often want to reach directly. Keep it to one level. Nested flyouts, where a submenu opens beside another submenu, are hard to use with a mouse and harder with a keyboard or on a touch screen.
Mega menu
A mega menu is a large panel that shows grouped links under headings. Later chapters cover when it is justified and how to build it. For now, treat it as the option you reach for last, because it needs the most design and testing.
A decision flow
The last branch matters. If you have many children that do not group well, a bigger menu will not fix the structure. Go back to your content and reduce or reorganize it.
Common mistakes
- Choosing by appearance. A mega menu looks impressive, but a site with eight pages gains nothing from one.
- Hiding the main tasks. If the top task is inside a submenu, move it to the top level.
- Relying on hover. Touch and keyboard users cannot hover. Every pattern must work with a click or tap and with the keyboard.
- Using different patterns on different pages. Keep the primary navigation consistent so users learn it once.
Exercise
A documentation site has 4 top-level sections. One of them, "Guides", has 40 pages that fall into 6 topic groups. Which pattern fits, and why?
Show answer
A mega menu, or a simple menu that links to a Guides landing page. Only Guides is large, and its pages group naturally under headings, which is what a mega menu panel is for. A plain dropdown would be a long unsorted list. If the landing page lists the groups clearly, the simple menu is the lower-cost option.