Skip to the content

Navbar

Navbars anchor wayfinding: they surface brand identity, primary links, search, and account actions in a single, predictable row. A well-structured bar keeps page chrome minimal while giving readers a reliable place to start and to recover if they get lost.

Use the navbar whenever a view needs global navigation or key contextual actions. Combine brand marks, knobs, search, and utilities in a consistent order, and rely on toggles to adapt layouts for smaller screens without sacrificing clarity or accessibility.

Overview

Core layout flows from left to right: start with the brand, follow with primary navigation, then utility areas like search suggestions and auth links. On small screens a menu button shows and hides the rest: a <details class="navbar-toggle"> with the icons in its <summary>. Give the summary an aria-label, because it only shows an icon; screen readers announce it as a button that is expanded or collapsed.

The navbar stays at the top of the page and gives visitors a consistent way to move around: the brand leads back home, the menu opens the main sections, and search and account links sit on the right.

Accessibility: give the menu button a name with aria-label, keep focus outlines on links and controls, and ensure suggestion panels are navigable with a keyboard and dismissible when focus moves away.

<header class="navbar">
  <a href="..." id="brand">...</a>

  <details class="navbar-toggle">
    <summary aria-label="Menu">
      <svg class="icon menu" aria-hidden="true">...</svg>
      <svg class="icon close" aria-hidden="true">...</svg>
    </summary>
  </details>

  <nav>
    <ul class="knobs">
      <li class="active"><a href="">...</a></li>
      <li><a href="">...</a></li>
      <li><a href="">...</a></li>
    </ul>
  </nav>

  <div class="spacer"></div>

  <div class="suggestions">
    <form class="group">
      <svg class="icon"></svg>
      <input type="search" class="prepend-icon" placeholder="Search...">
    </form>
    <div class="panel">...</div>
  </div>

  <nav>
    <ul>
      <li><a href="...">...</a></li>
    </ul>
  </nav>
</header>

Branding

Brand treatments can be text-only, icon-only, or a combination—choose the variant that reads clearly at navbar height. Keep spacing consistent so the brand doesn’t wobble between pages, and make sure the brand always links back to the home or top-level destination.

Keep it identifiable: supply an aria-label when the brand is icon-only, and avoid repeating the id="brand" on multiple elements in a single navbar to keep markup valid.

<header class="navbar">
  <a href="..." id="brand">...</a>

  <a href="..." id="brand">
    <svg></svg>
  </a>

  <a href="..." id="brand" class="ball">...</a>

  <a href="..." id="brand" class="ball">
    <svg></svg>
  </a>
</header>

Spacer

Spacers are flexible separators that push groups to opposite ends of the bar—ideal for centering navigation while keeping brand and account actions aligned. Use them sparingly to avoid uneven gaps and to maintain predictable scan patterns across pages.

<header class="navbar">
  <div class="spacer"></div>
</header>