Components
Navigation Menu
A website header: links and triggers whose panels open on hover or click, with arrow keys between items and Escape to close.
Ombelle · light
Navigation Menu
Installation
Run in a project initialized with an Ombelle preset (see Get started). The component uses the saved project preset. Run the command from your app folder; it shows the changes and asks before writing.
pnpm dlx @ombelle-ui/cli@1.1.2 add navigation-menuAdds components/ui/navigation-menu.tsx and installs react, @radix-ui/react-navigation-menu, clsx, tailwind-merge, lucide-react with lifecycle scripts disabled. This is a client component.
In a liquid glass project the plan adds a notice that accessibility is not guaranteed, because text contrast depends on the background behind the glass.
Usage
example.tsx
import { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger } from '@/components/ui/navigation-menu'
const docs = [{ href: '/docs', title: 'Introduction', description: 'What Ombelle is and how it works' }, { href: '/docs/installation', title: 'Installation', description: 'Add Ombelle to a project' }, { href: '/docs/theming', title: 'Theming', description: 'Presets, families and tokens' }]
export function Example(){return <NavigationMenu aria-label="Main"><NavigationMenuList><NavigationMenuItem><NavigationMenuTrigger>Docs</NavigationMenuTrigger><NavigationMenuContent>{docs.map(doc => <NavigationMenuLink key={doc.href} href={doc.href}><span>{doc.title}</span><p>{doc.description}</p></NavigationMenuLink>)}</NavigationMenuContent></NavigationMenuItem><NavigationMenuItem><NavigationMenuLink href="/components" variant="trigger" active>Components</NavigationMenuLink></NavigationMenuItem><NavigationMenuItem><NavigationMenuLink href="/blog" variant="trigger">Blog</NavigationMenuLink></NavigationMenuItem><NavigationMenuIndicator /></NavigationMenuList></NavigationMenu>}API and states
- API
- NavigationMenu (viewport, value, defaultValue, onValueChange), NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink (href, active, variant default or trigger), NavigationMenuIndicator, NavigationMenuViewport
- Minimum states
- Closed, panel open, current page, focus, hover, narrow screen (one column panel)
- Native basis
- Reviewed Radix Navigation Menu; Base UI Navigation Menu in the Base UI edition
- Styles
- Stable in Ombelle, Papier, Organic, Retro futurism, minimalist, neo-brutalism and flat, light and dark. Liquid glass: stable, accessibility not guaranteed.