Skip to main content

Navigation Menu

A site navigation bar with hover intent, a shared viewport that morphs between panels, and keyboard navigation.

route=/docs/introduction·horizontal

Customize

Switch blur (px)4
Spring speed1
Open delay (ms)120
Close delay (ms)220

Installation

npx shadcn@latest add @kinetic/navigation-menu

Usage

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>

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.

PropTypeDefaultDescription
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.
viewportbooleantrueUses a shared spring-morphing viewport below (or beside) the bar when true, or per-item inline dropdowns when false.
blurPx / speednumber4 / 1Directional content switch blur (0-12 px) and spring speed multiplier (0.25-4).
openDelay / delayDuration / closeDelay / skipDelayDurationnumber120 / 120 / 220 / 300Hover intent open delay (ms), close grace period (ms), and instant-switch skip window (ms).
value / defaultValue / onValueChangestring | 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.

PropTypeDefaultDescription
active / asChild / onSelect (NavigationMenuLink)boolean / boolean / (event) => voidfalseMarks the current route active, clones link props onto a child router Link, and handles selection before auto-closing.
forceMount (Content / Indicator / Viewport)booleanfalseKeeps the slot mounted in the DOM when closed with data-state='closed'.

Notes

Do not mount a second NavigationMenuViewport when viewport={true} (default). Pass viewport={false} if each dropdown should anchor directly beneath its own NavigationMenuItem.