React Navigation Menu
A glass React navigation menu whose items open rich dropdown panels, with hover intent, a panel that morphs between items, and full keyboard support.
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/navigation-menu.jsonAcme
Everything your team ships with
Analytics, automations and billing in one place.
NavigationMenuNavigationMenuItemNavigationMenuLinkNavigationMenuListNavigationMenuContent- +4 more
- +1 more
A site header with rich panels
Hover or focus Products: a featured card beside icon links. Move to Developers and the panel resizes while the content slides in from the side you came from.
Acme
Hover or focus a menu item: the panel resizes between Products and Developers and the content slides from the side you came from.
import { Button } from "@/components/sheenui/button/button";
import { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger } from "@/components/sheenui/navigation-menu/navigation-menu";
// Package build (after the first npm release, or a packed tarball): import { Button, NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger } from "@sheenui/theme";
// This example also uses button: npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/button.json
const products = [
{ title: "Charts", text: "Accessible chart components, each with a data table." },
{ title: "Blocks", text: "Login, checkout, settings and notification centre." },
{ title: "Dashboards", text: "Five analytics templates with live data." },
];
export function Example() {
return (
<div className="glass-2 flex items-center gap-3 rounded-sheen-full py-2 ps-5 pe-2">
<strong>Acme</strong>
<NavigationMenu aria-label="Main">
<NavigationMenuList>
<NavigationMenuItem value="products">
<NavigationMenuTrigger>Products</NavigationMenuTrigger>
<NavigationMenuContent className="w-[min(40rem,calc(100vw-2rem))]">
<div className="grid gap-2 sm:grid-cols-[13rem_1fr]">
<NavigationMenuLink plain href="#featured" className="flex flex-col justify-end gap-1 rounded-sheen-lg p-4 text-white [background-image:linear-gradient(160deg,var(--sheen-accent),oklch(55%_0.2_320))]">
<span className="text-base font-semibold">Liquid Glass</span>
<span className="text-xs">Real refraction for hero surfaces.</span>
</NavigationMenuLink>
<ul className="m-0 grid list-none gap-1 p-0">
{products.map((p) => (
<li key={p.title}>
<NavigationMenuLink plain href={`#${p.title.toLowerCase()}`}>
<span className="block text-sm font-medium text-sheen-fg">{p.title}</span>
<span className="block text-xs text-sheen-fg-muted">{p.text}</span>
</NavigationMenuLink>
</li>
))}
</ul>
</div>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink href="#pricing" active>Pricing</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
<Button size="sm" className="ms-auto">Sign in</Button>
</div>
);
}Files to copy
4 folders · 3 files · 4 packages
- From
theme/src/ components/navigation-menu/components/status-icons/lib/{cn.ts, popup-a11y.ts, popup-motion.ts}styles/
- shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/navigation-menu.jsonRegistry item: navigation-menu. The styles need the Tailwind v4 glass UI setup.- The examples also use
components/button/components/spinner/hooks/{use-latest.ts, use-magnetic.ts, use-media-query.ts, use-preferences.ts}motion/{gate.ts, tokens.ts}lib/{form.ts, state-light.tsx}
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/button.json- Packages
pnpm add @base-ui/react clsx motion tailwind-merge
NavigationMenu props
Parts
NavigationMenuLink props
Keyboard
Accessibility
- Renders a <nav> landmark: give it an aria-label ("Main", "Docs") so it is told apart from other navigation.
- Triggers are buttons with aria-expanded and aria-controls; links use aria-current="page" when active.
- The dropdown is not a menu role: it is a region of ordinary links, which is what site navigation should be.
- Hover opens after delay (120 ms) and closes after closeDelay (150 ms); clicking and the keyboard open it at once, so touch and keyboard users never depend on hover.
- On touch screens targets are 44px. Under reduced motion the panel fades and does not resize or slide.
When to use the navigation menu
- Use it as a mega menu for a product site header where Products, Solutions and Resources each open a panel of titled links with short descriptions, the kind of mega-menu pattern that a flat list of links cannot carry.
- Use it for a documentation site whose top bar groups guides, API reference and examples, so visitors can scan every section from one shared glass panel without leaving the current page.
- The shared panel resizes to each item's content and slides between items, so it suits menus with panels of different sizes, from a three-link list to a grid up to 36rem wide.
- Skip it when you only have a handful of plain links with no dropdowns; Horizontal nav is simpler and folds into a menu on narrow screens, while Menu is the right tool for action lists.
- Pair it with Button for a call to action beside the bar, Badge for a New label inside a panel link, and Drawer to hold the navigation on phones.
Frequently asked questions
Related pages
67 components pages in all: browse them on All components.
By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .