Skip to content
Fleetline

Global navigation bar

Usage

The top nav is the app header on every Fleetline screen: product logo (home), the 4–6 main areas, search, notifications and the profile menu. Use the side nav for the second level inside an area (e.g. the workshop sections).

Anatomy

  1. Menu toggle — .top-nav__toggle (narrow only)
  2. Brand — a.top-nav__brand to the home dashboard
  3. Main nav — nav.top-nav__nav[aria-label=Main] with .top-nav__link items
  4. Search — form.top-nav__search[role=search]
  5. Actions — notifications .icon-btn and the profile menu button

Examples

Resize the window, or compare the narrow demos, to see the collapsed layout. States marked hover, focus-visible and active are frozen with .is-hover, .is-focus-visible, .is-active. Those classes share their rule with the real pseudo-class, so what you see is exactly what users get. Never use them in product code.

Global navigation bar

Fleetline

Current page: "Work orders" — semibold text and a bottom bar, not color alone.

Fleetline

Narrow container: links and search move behind the Menu button.

Fleetline

Open: search first, then links with a 44px touch target. Esc closes and returns focus to Menu.

<header class="top-nav top-nav--sticky">
  <div class="top-nav__bar">
    <button type="button" class="btn btn--ghost top-nav__toggle" aria-controls="main-nav-panel">
      <svg class="btn__icon" aria-hidden="true" focusable="false"><use href="#icon-menu"></use></svg>
      <span class="btn__label">Menu</span>
    </button>
    <a class="top-nav__brand" href="/">…Fleetline</a>
    <div class="top-nav__panel" id="main-nav-panel">
      <nav class="top-nav__nav" aria-label="Main">
        <ul class="top-nav__list">
          <li><a class="top-nav__link" href="/dispatch">Dispatch</a></li>
          <li><a class="top-nav__link" href="/work-orders" aria-current="page">Work orders</a></li>
          …
        </ul>
      </nav>
      <form class="top-nav__search" role="search" action="/search">
        <label class="sr-only" for="q">Search vehicles and work orders</label>
        <svg class="top-nav__search-icon" aria-hidden="true" focusable="false"><use href="#icon-search"></use></svg>
        <input class="top-nav__search-input" id="q" type="search" name="q" placeholder="Plate, VIN or WO number">
      </form>
    </div>
    <div class="top-nav__actions">
      <button type="button" class="icon-btn" aria-label="Notifications, 3 unread">…</button>
      <!-- profile: menu button, see menu.html -->
    </div>
  </div>
</header>
<script type="module">
  import { init as nav } from "./js/top-nav.js"; import { init as menus } from "./js/menu.js";
  nav(); menus();
</script>

API

HookValuesPurpose
.top-navblock classApp header; inline-size container named top-nav
.top-nav--stickymodifierSticks to the top (--z-sticky)
.top-nav__bar | __brand | __logo | __panel | __nav | __list | __link | __search | __search-input | __search-icon | __actions | __avatarpartsSee anatomy
.top-nav__toggle[aria-controls]partMenu button; js/top-nav.js adds and toggles aria-expanded
aria-current="page"attributeCurrent area

Do and don't

"Dispatch · Vehicles · Work orders · Depots · Reports"

Do keep 4–6 top-level places with short noun labels.

"Home · Fleet · New WO · Settings · Help · Billing · Reports · More"

Don't mix actions and utilities into the main links or exceed what fits at tablet width.

Accessibility

Keyboard interaction
KeyBehavior
TabMoves through Menu (narrow), brand, links, search, notifications, profile
Enter / Space (Menu)Opens / closes the panel
EscCloses the open panel and returns focus to Menu

Tokens

Custom propertyPurpose
--color-bg-surface, --color-border-defaultBar
--color-text-muted | -defaultLink rest / hover and current
--color-selected-border | -bg | -fgCurrent bar (and mobile current fill)
--input-bg | -border | -radiusSearch field
--size-control-md | -lg, --size-touch-targetHeights
--z-stickySticky variant