Navigation Menu
A site navigation bar with hover intent, a shared viewport that morphs between panels, and keyboard navigation.
Customize
Installation
npx shadcn@latest add @kinetic/navigation-menuUsage
Each NavigationMenuItem holds a trigger and its content, or a single direct link styled with navigationMenuTriggerStyle().
import {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
navigationMenuTriggerStyle,
} from "@/components/kinetic/ui/navigation-menu";
export function SiteNav() {
return (
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem value="docs">
<NavigationMenuTrigger>Docs</NavigationMenuTrigger>
<NavigationMenuContent>
<ul className="grid w-72 gap-1 p-2">
<li>
<NavigationMenuLink href="/docs">Introduction</NavigationMenuLink>
</li>
</ul>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink href="/blog" className={navigationMenuTriggerStyle()}>
Blog
</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
);
}Viewport
With viewport (the default) every panel renders inside one shared surface that resizes between items. Set viewport={false} to drop each panel directly below its trigger.
<NavigationMenu viewport={false}>...</NavigationMenu>Orientation
Set orientation="vertical" for a side menu. Arrow keys and the viewport anchor follow the axis, and dir supports right-to-left layouts.
<NavigationMenu orientation="vertical">...</NavigationMenu>Hover timing
openDelay waits before opening, closeDelay gives a grace period before closing, and skipDelayDuration switches instantly between items that are already warm. Values are in milliseconds.
<NavigationMenu openDelay={80} closeDelay={300}>...</NavigationMenu>Active link
Mark the current route with active on NavigationMenuLink, and use asChild to render your router's link.
<NavigationMenuLink active asChild>
<Link href="/docs">Docs</Link>
</NavigationMenuLink>Motion preferences
Switching panels slides the content with a directional blur. Tune it with blurPx and speed. Reduced motion swaps panels without movement.
API Reference
NavigationMenu
Zero-dependency navigation bar coordinating shared viewport morphing, directional content handoff, hover-intent delays, and keyboard navigation.
| Prop | Type | Default | Description |
|---|---|---|---|
orientation / dir | "horizontal" | "vertical" / "ltr" | "rtl" | "horizontal" / "ltr" | Switches bar axis, arrow key navigation, and viewport anchoring between horizontal and vertical layouts, plus LTR/RTL direction. |
viewport | boolean | true | Uses a shared spring-morphing viewport below (or beside) the bar when true, or per-item inline dropdowns when false. |
blurPx / speed | number | 4 / 1 | Directional content switch blur (0-12 px) and spring speed multiplier (0.25-4). |
openDelay / delayDuration / closeDelay / skipDelayDuration | number | 120 / 120 / 220 / 300 | Hover intent open delay (ms), close grace period (ms), and instant-switch skip window (ms). |
value / defaultValue / onValueChange | string | null | - | Controlled or uncontrolled active NavigationMenuItem value. |
NavigationMenuList / NavigationMenuItem / NavigationMenuTrigger / NavigationMenuContent / NavigationMenuLink / NavigationMenuIndicator / NavigationMenuViewport
Compound slots with sliding hover pill, rotating chevron, spring-gliding indicator pointer, directional blur-slide panels, and zero-dep asChild link support.
| Prop | Type | Default | Description |
|---|---|---|---|
active / asChild / onSelect (NavigationMenuLink) | boolean / boolean / (event) => void | false | Marks the current route active, clones link props onto a child router Link, and handles selection before auto-closing. |
forceMount (Content / Indicator / Viewport) | boolean | false | Keeps the slot mounted in the DOM when closed with data-state='closed'. |