StartFoundationsComponentsContent

Navigation menu

A navigation menu is a site's or app's main navigation: a row of links where some items open a panel of more links.

Stable Figma
OverviewUsageAPIAccessibility
Products
  • Analytics
  • Billing
Pricing Docs
<tk-navigation-menu label="Main">
  <tk-navigation-menu-item>
    Products
    <ul slot="panel">
      <li><tk-link href="/analytics" treatment="quiet">Analytics</tk-link></li>
      <li><tk-link href="/billing" treatment="quiet">Billing</tk-link></li>
    </ul>
  </tk-navigation-menu-item>
  <tk-navigation-menu-item href="/pricing">Pricing</tk-navigation-menu-item>
  <tk-navigation-menu-item href="/docs" current>Docs</tk-navigation-menu-item>
</tk-navigation-menu>

Anatomy

Part What it is
tk-navigation-menu a <nav> landmark holding a list of items
tk-navigation-menu-item with href a link
tk-navigation-menu-item with a panel a button that opens the panel; a chevron shows it
panel a floating surface with your links; you decide its layout

An item is a link or a button, never both. With both href and a panel, the panel wins. There is no disabled: to make an item not a link, leave out href.

Panels

The panel's content is yours. For a short dropdown, write a list of quiet links:

Resources
  • Guides
  • Blog
<tk-navigation-menu label="Main">
  <tk-navigation-menu-item>
    Resources
    <ul slot="panel">
      <li><tk-link href="/guides" treatment="quiet">Guides</tk-link></li>
      <li><tk-link href="/blog" treatment="quiet">Blog</tk-link></li>
    </ul>
  </tk-navigation-menu-item>
</tk-navigation-menu>

For a larger panel, lay out columns, each with a heading and a list:

Products

Analyze

  • Dashboards

Operate

  • Billing
<tk-navigation-menu label="Main">
  <tk-navigation-menu-item>
    Products
    <div slot="panel" style="display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-24)">
      <div><h3>Analyze</h3><ul><li><tk-link href="/dashboards" treatment="quiet">Dashboards</tk-link></li></ul></div>
      <div><h3>Operate</h3><ul><li><tk-link href="/billing" treatment="quiet">Billing</tk-link></li></ul></div>
    </div>
  </tk-navigation-menu-item>
</tk-navigation-menu>
  • Put only links in a panel. No buttons, actions, or form fields.
  • Don't put a panel inside a panel.
  • The panel is at most 720px wide and 560px tall, and scrolls past that.

Opening

  • A click, Enter, or Space on an item opens its panel. Down opens it and moves to its first link.
  • Hovering opens it after a short delay, so a pointer passing by doesn't flash it open. The pointer can move diagonally to the panel without closing it.
  • Focus alone never opens a panel, and neither does a touch-hover.
  • One panel is open at a time. Esc, a click outside, the pointer leaving, or focus leaving the menu closes it. It never closes on a timer.

Current page

current marks the page people are on. The item gets a 2px underline and stays a link.

Guides Components Tokens
<tk-navigation-menu label="Docs sections">
  <tk-navigation-menu-item href="/guides">Guides</tk-navigation-menu-item>
  <tk-navigation-menu-item href="/components" current>Components</tk-navigation-menu-item>
  <tk-navigation-menu-item href="/tokens">Tokens</tk-navigation-menu-item>
</tk-navigation-menu>

States

At rest, items are muted. Hover and keyboard focus darken an item and underline its label; focus also shows a ring. An item with an open panel stays dark and its chevron turns over.

Mobile

The navigation menu has no breakpoint of its own. On narrow screens, put the same links in a Sheet; the Sidebar page shows how.