cnippet/ui
  1. ui
  2. navigation
  3. navigation menu

navigation

Navigation Menu

A site header menu whose panels open on hover or click and slide between each other, for product, docs and resource links. Copy-paste ready.

API Reference

Installation

Usage

Anatomy

Good to know

  • All items share one popup. Moving between triggers resizes it and slides the content left or right, depending on which way you moved.
  • Triggers open on hover and on click. Arrow keys move between triggers, and Tab moves into the open panel.
  • Give each content panel a width from sm: up (the examples use sm:w-[30rem]). On small screens it fills the viewport minus 2rem.
  • NavigationMenuLink defaults to a block link for use inside a panel. Use variant="trigger" for a top-level link that matches the triggers. Pass active to mark the current page.
  • On phones, swap the menu for a Sheet or Drawer with the same links.

API Reference

Takes all Base UI NavigationMenu.Root props (value, defaultValue, onValueChange, delay, closeDelay, orientation), plus:

Other parts take their Base UI props. See the Base UI docs.

Examples

Docs menu

Sections of a docs site, with a two-column panel for the longer list.