Skip to content
English
Navigation menu comes with Pro. Its preview shows once you unlock it.

How it works

Every panel is laid out at its own width and measured; one background surface animates width, height and translateX to the active box, clamped inside the bar, while the content cross-fades with a 28px directional slide. A bridge element covers the gap below the bar so the pointer can travel into the panel, and a short close delay forgives diagonal moves.

Use it for

  • Marketing and documentation sites with a few rich sections.
  • Headers where each section benefits from descriptions and icons.

Look elsewhere when

  • Application commands: use a menubar or dropdown menu.
  • Small screens: collapse into a drawer instead.

Usage

import { NavigationMenu } from './NavigationMenu.jsx'

export function Header() {
  return (
    <NavigationMenu
      label="Main"
      items={[
        {
          id: 'product',
          label: 'Product',
          width: 560,
          featured: { title: 'Canvas', description: 'One shared board.', href: '/canvas' },
          links: [
            { title: 'Boards', description: 'Plan work in flexible views', href: '/boards', icon: <BoardIcon /> },
            { title: 'Docs', description: 'Write together', href: '/docs', badge: 'New' },
          ],
        },
        { id: 'resources', label: 'Resources', width: 300, links: [{ title: 'Guides', href: '/guides' }] },
        { id: 'pricing', label: 'Pricing', href: '/pricing' },
      ]}
    />
  )
}

Props

PropTypeDefaultWhat it does
items{ id, label, href?, width?, featured?: { title, description, href }, links?: { title, description?, href, icon?, badge? }[], content?: ReactNode }[]—Top items. An item with href is a plain link; otherwise it opens a panel built from featured and links, or your own content. width is the panel's preferred width (capped by the bar).
labelstring—Accessible name of the nav landmark.
defaultOpenstring | nullnullItem open on first render.
openDelaynumber120Hover delay in ms before the first panel opens.
closeDelaynumber240Grace period in ms after the pointer leaves.
...restHTMLAttributes<HTMLElement>—Other attributes go to the <nav>; set --ds-nm-duration in style to change the morph time.

Accessibility

  • A nav landmark with a list of disclosure buttons (aria-expanded, aria-controls) and plain links; the panel is a region labelled by its trigger.
  • Enter, Space or Down opens a panel and focuses its first link; Left and Right move between triggers and switch the open panel.
  • Tab from an open trigger enters the panel, Tab past the last link continues to the next trigger, Shift+Tab from the first link returns; Up and Down move between links.
  • Escape closes and returns focus to the trigger; a click outside closes.
  • Hidden panels are inert and aria-hidden, so only the open one is reachable.
  • With reduced motion panels only fade; the background, caret and chevron do not move.

Motion

Background width, height and position 320ms cubic-bezier(0.22, 1, 0.36, 1); content slides 28px with the same curve, the old one fades in 180ms; the panel opens in 220ms from 0.97 scale at the caret.

Add it to your project

Pro members copy a prompt and their coding agent installs the source, the same way as the free components.

NavigationMenu.jsxnavigation-menu.csstokens.cssREADME.md

Both files install together. The stylesheet reads the design tokens in tokens.css and carries fallbacks, so it also works alone.

Navigation