The Navigation Bar
also known as: The Nav, The Header, The Top Bar, The Wayfinder
"The Navigation Bar is the dungeon's cartographer made manifest. It does not ask anything of the user, nor does it obstruct their path. At its best it is entirely unremarkable — a persistent orientation system so well-integrated into the dungeon's fabric that no user would think to notice it. This is its highest achievement. Invisibility, in the Navigation Bar, is not failure. It is mastery."
— Excerpt from 'Passive Infrastructure and the Ecology of the Codebase,' Proceedings of the Heuristic Order, Third Annual Symposium
The Navigation Bar occupies the threshold — the topmost stratum of the dungeon, persistent across every room, present whether or not the user has asked for it. In this it differs from every other creature in the Codebase: it does not wait to be summoned. It is simply there. Its function is orientation. It tells the user where they are, where they might go, and — through the active state — where they have been. When these three communications are clear, the Navigation Bar fulfils its purpose entirely and asks nothing further of the user's attention.
The Navigation Bar's pathological form is characterised not by aggression but by ambition. A Navigation Bar that attempts to carry too much — too many top-level items, nested dropdowns of excessive depth, utility icons without labels, a search field, a language selector, a notification badge, a user avatar, and a promotional banner — has ceased to be an orientating device and become a complexity to be navigated in its own right. The dungeon now has two puzzles at its entrance: the content, and the mechanism for finding the content. This is considered an ecological imbalance.
The creature's mobile behaviour warrants particular attention. At reduced viewport widths, the Navigation Bar typically collapses its items behind a toggle — the Hamburger Menu, a subspecies so thoroughly documented that it has its own entry in the Pest Register. The collapse is not inherently problematic; screen space at mobile widths genuinely cannot accommodate a full navigation structure. The problem arises when the collapse mechanism is inaccessible — when the toggle has no accessible name, when the revealed menu traps focus incorrectly or not at all, and when the open/closed state is communicated only visually.
swords Vital Statistics
auto_awesome Special Abilities
aria-current="page" on the active link). The visual treatment alone is insufficient — colour-blind users, low-vision users, and screen reader users require the programmatic signal. The aria-current attribute is the mechanism by which this is delivered. Its omission is a quiet failure, unremarkable to sighted users and disorienting to those who depend on it.
aria-expanded. When the menu opens, focus may optionally move to the first menu item. When the menu closes, focus returns to the toggle. The expanded menu is implemented as a list of links rather than a visual overlay with arbitrary tab behaviour. The Escape key closes the menu. These are not suggestions.
<nav> element with an aria-label that distinguishes it from any secondary navigation that may exist on the page ("Main navigation" is the conventional label). This declaration creates a navigable landmark in the accessibility tree, allowing screen reader users to jump directly to the navigation without traversing the page. A page with multiple unlabelled <nav> elements — "navigation," "navigation," "navigation" — provides an ambiguous landmark list that serves no one.
shield Weaknesses
<nav>witharia-label="Main navigation"— creates a named landmark that screen reader users can navigate directly toaria-current="page"on the active link — programmatic active state for assistive technology;class="active"alone is not sufficient- Skip-to-content link — must be the first focusable element in the DOM; must become visible on focus; must point to the main content region
aria-expandedon mobile toggle — communicates open/closed state to assistive technology; a toggle with no state is a button with no feedback- Keyboard operability — all links must be reachable by Tab; no item should require hover to be accessible
- Restraint — a Navigation Bar with fewer than seven top-level items is considerably more usable than one with more; the urge to surface everything at the top level must be resisted
category Known Variants
- The Sidebar Navigation — migrates the Navigation Bar to the left or right edge of the dungeon, providing persistent vertical navigation. Common in dashboard and utility applications. Offers more room for items but introduces layout complexity at mobile breakpoints.
- The Breadcrumb — a lightweight wayfinding variant that traces the user's current position as a hierarchical path. Best used alongside, not instead of, a primary Navigation Bar. Marked up as
<nav aria-label="Breadcrumb">witharia-current="page"on the final item. - The Tab Bar — a mobile-native variant that fixes five or fewer primary destinations to the bottom of the screen, within thumb reach. The Navigation Bar's most successful mobile adaptation. Limited to five items by convention and screen space.
- The Mega Menu — a boss-level variant in which hovering or activating a top-level item reveals a large panel containing secondary and tertiary navigation options, often with promotional imagery. Its accessibility implications are extensive. The Heuristic Order has opened a separate file.
- The Sticky Navigation Bar — remains fixed to the top of the viewport as the user scrolls. Consumes permanent vertical space. Justifiable on long-scrolling content; questionable on short pages where the original navigation remains in view regardless.
- The Contextual Navigation — appears only within a specific section of the dungeon, providing sub-section orientation. Often confused with the primary Navigation Bar. Must carry a distinct
aria-labelto avoid ambiguity in the landmark tree.
edit_note Field Notes
Note I. — The Navigation Bar is not a sitemap. It should contain the four to six destinations that represent the primary tasks a user might want to accomplish. Everything else belongs deeper in the hierarchy. The temptation to surface secondary and tertiary content at the top level — to make it "easy to find" — produces a Navigation Bar so dense that nothing is easy to find. Hierarchy is not concealment. It is organisation.
Note II. — The active state must be visually unambiguous. An underline alone is insufficient against dark backgrounds. A colour change alone is unreliable for colour-blind users. The most robust active state combines a visual treatment that does not rely on colour alone — weight, position, a geometric indicator — with the programmatic aria-current attribute. Both channels, always.
Note III. — Do not place the logo inside the <nav> element. The logo is typically an anchor to the home page, but it is not navigation in the landmark sense. Placing it outside the <nav> and letting the <nav> contain only navigational links produces a cleaner landmark tree and a more accurate document structure.