U.S. flagA digital services project by Flexion

Header

navigationUSWDS-derivedinteractive

Site header with logo, primary navigation, and responsive mobile menu.

Reference: USWDS documentation ↗

Variants

Default

Signed In

With Current Page

Contract

Class mapping

USWDSFlexNotes
usa-header.flex-headerOuter header element
usa-header--basic.flex-header (default)Basic variant is the default
usa-navbar.flex-header__innerInner container with logo and nav
usa-logo.flex-header__logoLogo container
usa-menu-btn.flex-header__menu-btnMobile menu hamburger button
usa-nav.flex-header__navPrimary navigation container
usa-nav__close.flex-header__close-btnMobile nav close button
usa-nav__primary.flex-header__nav-listPrimary nav link list
usa-nav__primary-item.flex-header__nav-itemIndividual nav item
usa-nav__link / usa-current.flex-header__nav-link / .flex-header__nav-link--currentNav link and current page indicator
usa-overlay.flex-header__overlayMobile nav background overlay
usa-accordion__button (as disclosure trigger).flex-header__user-triggerProfile dropdown trigger — USWDS uses accordion button semantics for submenus; ours uses a menu-button disclosure for account actions
usa-nav__submenu.flex-header__user-panelDisclosure panel containing user identity, theme preference, and sign out

Verified properties

background-colorcolorfont-familyfont-sizefont-weightline-heighttext-decorationpaddingborder-bottom

Intentional differences

max-width: ours = 960px, USWDS = 64rem (1024px)

We use 960px max-width to align with banner and content areas

Behavior promises

  • ✓ Menu button click opens mobile nav overlay with aria-expanded="true"
  • ✓ Close button click hides nav, restores scroll, returns focus to menu button
  • ✓ Escape key closes nav if open
  • ✓ Overlay click closes nav
  • ✓ Resize across breakpoint while nav is open resets mobile nav state
  • ✓ User-menu trigger click toggles aria-expanded and the panel hidden attribute
  • ✓ Escape key closes the user menu and returns focus to the trigger
  • ✓ Outside click closes the user menu without stealing focus
  • ✓ Crossing to the mobile breakpoint force-closes the user menu disclosure

Source CSS