Start here
  • InstallationAdd Nelumbo to a shadcn project
  • ThemingBrand accent, neutrals, dynamic color
  • Biology componentsSequences, maps, plates and trees
  • katalyx.bio

    Navigation Menu

    The main navigation of a site: a row of links, some of which open a panel of choices. Hover, click or use the arrow keys; the raised pill follows you, and the panel reshapes itself to fit what it holds.

    Install

    npx shadcn@latest add @nelumbo/navigation-menu

    Product site header

    Three panels and two plain links. Move between Products, Solutions and Resources: the surface springs to the size of the next panel and its content slides in from the side you came from. Pricing is the current page (aria-current).

    Acme

    Panels under their own items

    viewport={false} drops the shared surface: each panel is its own popover under its item, which suits a short menu. Add NavigationMenuIndicator for a small notch that springs between triggers.

    Keyboard

    Tab moves into the menu and then out of it. Left and Right move between triggers and links, Enter or Space opens a panel, Tab moves into it and Tab and the arrow keys move through its links, and Escape closes the panel and returns to its trigger.

    Usage

    import {  NavigationMenu, NavigationMenuContent, NavigationMenuFeatured, NavigationMenuItem,  NavigationMenuLink, NavigationMenuList, NavigationMenuRichLink,  NavigationMenuTrigger, navigationMenuTriggerStyle,} from "@/components/ui/navigation-menu"​<NavigationMenu>  <NavigationMenuList>    <NavigationMenuItem>      <NavigationMenuTrigger>Products</NavigationMenuTrigger>      <NavigationMenuContent>        <div className="grid gap-2 sm:w-[37rem] sm:grid-cols-[1fr_13rem]">          <ul className="grid gap-1">            <li>              <NavigationMenuRichLink asChild icon="bolt" title="Automations" description="Run work on a schedule.">                <Link href="/automations" />              </NavigationMenuRichLink>            </li>          </ul>          <NavigationMenuFeatured asChild icon="stars" title="Nelumbo 2.0" description="What's new.">            <Link href="/new" />          </NavigationMenuFeatured>        </div>      </NavigationMenuContent>    </NavigationMenuItem>    <NavigationMenuItem>      <NavigationMenuLink asChild active={pathname === "/pricing"} className={navigationMenuTriggerStyle()}>        <Link href="/pricing">Pricing</Link>      </NavigationMenuLink>    </NavigationMenuItem>  </NavigationMenuList></NavigationMenu>
    PropTypeDefaultThe list, items, triggers, content, link, indicator and viewport pass every other Radix prop through. Below the sm breakpoint the menu fills the width, the track wraps, and panels become a single column.
    viewportbooleantrueNavigationMenu: render panels in one shared surface that morphs between them; false opens each under its item
    value / defaultValue / onValueChangestringRadix: the open item, controlled or not
    delayDuration / skipDelayDurationnumber200 / 300Radix: hover open delay, and the window in which moving to another trigger opens it at once
    activebooleanfalseNavigationMenuLink: the current page; sets aria-current and an inverse fill
    iconIconNameNavigationMenuRichLink and NavigationMenuFeatured: the Material Symbol
    title / descriptionReactNodeNavigationMenuRichLink and NavigationMenuFeatured: the text
    asChildbooleanfalseLink parts: render your router's Link as the only child