Components
Navigation Menu
A horizontal menu for top-level navigation. Items can open rich dropdown panels on hover or keyboard focus.
Navigation Menu is distinct from Sidebar navigation. It is horizontal, sits at the top of a surface, and is tuned for mouse and keyboard interaction.
Preview
Rendered with live Cognition tokens. Hover or focus "Resources" to open its panel, no dark: classes.
Variants
Default (links only)
Components
Tokens
Icons
Guidelines
With dropdowns
Components
Tokens
Icons
Guidelines
With icons
Components
Buttons, inputs, and the full library.
Tokens
Color, type, spacing, and radius.
Icons
The lucide set, sized and tinted.
Guidelines
How and when to use each piece.
With descriptions
A plain link bar, or a trigger that opens a panel of links, optionally with icons or descriptions. The panels are shown open for reference.
States
Default. Resting items.
Item hover.
Item active (current page).
Keyboard focused.
Components
Buttons, inputs, and the full library.
Tokens
Color, type, spacing, and radius.
Icons
The lucide set, sized and tinted.
Guidelines
How and when to use each piece.
Dropdown open, with the first item hovered.
Hover and the open dropdown cannot be shown at rest, so those states render statically. The preview opens the real panel.
API
Don't and Do
Don't use a Navigation Menu to move between sections of a single page. Jumping around within one view is the job of Tabs or an anchor list. A Navigation Menu is for moving across the app or site, not within a page.
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuTrigger>Resources</NavigationMenuTrigger>
<NavigationMenuContent>...</NavigationMenuContent>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>Use it for primary app or site navigation where top-level items may carry rich dropdown content.
import {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
} from "@/components/ui/navigation-menu";
export function PrimaryNav() {
return (
<NavigationMenu>
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuTrigger>Resources</NavigationMenuTrigger>
<NavigationMenuContent>
<ul className="grid w-[420px] gap-1 p-2 md:grid-cols-2">
<li>
<NavigationMenuLink href="/components">
Components
</NavigationMenuLink>
</li>
</ul>
</NavigationMenuContent>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
);
}