Navigation Menu
A collection of links for navigating websites — bare bar or floating pill, ghost / solid / underline triggers, mega-menu content with directional motion.
Installation#
pnpm dlx shadcn@latest add @davinciui/navigation-menuUsage#
Composition: NavigationMenu → NavigationMenuList → NavigationMenuItem → NavigationMenuTrigger + NavigationMenuContent / NavigationMenuLink.
Link composition: Use render={<Link href="/docs" />} on NavigationMenuLink for Next.js client-side routing, paired with navigationMenuTriggerStyle().
RTL: Wrap with dir="rtl" — trigger icon and popup placement flip automatically via Base UI Direction.
Composition#
Use the following composition to build a Navigation Menu:
NavigationMenu
├── NavigationMenuList
│ └── NavigationMenuItem
│ ├── NavigationMenuTrigger
│ └── NavigationMenuContent
│ └── NavigationMenuLink
├── NavigationMenuViewport
└── NavigationMenuIndicatorAPI Reference#
| Prop | Type | Default |
|---|---|---|
NavigationMenu · variantPill renders a floating frosted bar. | "default" | "pill" | "default" |
NavigationMenuListFlex list of items. | Component | — |
NavigationMenuItemSingle item. Wraps Trigger + Content or Link. | Component | — |
NavigationMenuTrigger · variantGhost wash, inverted pill, or Stripe-style underline. | "default" | "solid" | "underline" | "default" |
NavigationMenuTrigger · sizeComfortable or compact density. | "default" | "sm" | "default" |
NavigationMenuContentPopup content with fade, zoom, and rise motion. | Component | — |
NavigationMenuLink · activeCurrent-page state with aria-current. | boolean | false |
NavigationMenuLinkLink. Supports render prop for Next.js Link. | Component | — |
navigationMenuTriggerStyleShared trigger/link styles with variant + size. | cva | — |
orientationMenu orientation via Base UI. | "horizontal" | "vertical" | "horizontal" |
classNameAdditional CSS classes. | string | — |
Accessibility#
Built on Base UI navigation-menu primitives, which provide menu semantics, keyboard navigation, and focus management. Triggers show focus-visible rings, the chevron is aria-hidden, and active links set aria-current to page.
Motion#
Popups fade, zoom, and slide over 200ms, the chevron rotates 200ms, and the viewport animates width and height. All these use motion-reduce animate-none or transition-none; timings are fixed rather than prop-controlled.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

