{
  "schemaVersion": 1,
  "target": "react",
  "name": "navigation-menu",
  "version": "0.1.0",
  "category": "navigation",
  "title": "Navigation Menu",
  "description": "A top navigation bar with dropdown panels of links and descriptions, built on Base UI Navigation Menu, whose panel glides and resizes between triggers.",
  "tags": [
    "navigation",
    "menu",
    "header",
    "links",
    "base-ui"
  ],
  "requires": {
    "projectTypes": [
      "next",
      "vite-react"
    ],
    "styling": "tailwind-v4"
  },
  "npmDependencies": {
    "@base-ui/react": "^1.9.0"
  },
  "registryDependencies": [],
  "docsPath": "/components/navigation-menu",
  "props": [
    {
      "name": "NavigationMenu value / defaultValue / onValueChange",
      "type": "any / any / (value, details) => void",
      "description": "The open item's value; null when closed. Leave unset for an uncontrolled menu."
    },
    {
      "name": "NavigationMenu delay / closeDelay",
      "type": "number",
      "default": "50 / 50",
      "description": "Hover delays in ms before opening and closing."
    },
    {
      "name": "NavigationMenu align / sideOffset",
      "type": "\"start\" | \"center\" | \"end\" / number",
      "default": "\"start\" / 8",
      "description": "Panel alignment against the open trigger, and its gap below the triggers in pixels."
    },
    {
      "name": "NavigationMenu popupClassName",
      "type": "string",
      "description": "Classes for the floating panel, for example a different radius."
    },
    {
      "name": "NavigationMenuTrigger",
      "type": "Base UI NavigationMenu.Trigger props",
      "description": "Opens its item's panel on hover or click. Sets data-popup-open while open; the chevron turns."
    },
    {
      "name": "NavigationMenuContent",
      "type": "Base UI NavigationMenu.Content props",
      "description": "Panel content for a trigger. Set the width of your grid inside it (for example sm:w-[34rem])."
    },
    {
      "name": "NavigationMenuLink active",
      "type": "boolean",
      "default": "false",
      "description": "A top-level link with no panel. active sets aria-current=\"page\"."
    },
    {
      "name": "NavigationMenuPanelLink title / description / icon",
      "type": "ReactNode",
      "description": "A link inside a panel with a title, a one-line description, and an optional icon tile. Closes the panel when followed."
    },
    {
      "name": "render",
      "type": "ReactElement",
      "description": "On links, your router's link component, for example render={<Link href=\"/docs\" />}."
    }
  ],
  "accessibility": [
    "Renders a nav landmark; name it with aria-label (\"Main\" in the example).",
    "Triggers are buttons with aria-expanded. Left and Right arrows move between top-level entries; Enter, Space, or ArrowDown opens a panel while focus stays on the trigger, and Tab then moves into the panel's links in order.",
    "Escape closes the panel and returns focus to its trigger; moving focus out of the menu also closes it.",
    "The current page link has aria-current=\"page\" via the active prop.",
    "Panel links show a tint and an inset sky focus ring on keyboard focus.",
    "The panel grows from the open trigger in 260ms, then glides, resizes, and slides content toward the side the pointer moved to; it fades out in 110ms. With reduced motion the size and position change instantly and content only cross-fades without moving."
  ],
  "states": [
    "closed",
    "open",
    "switching"
  ],
  "files": [
    {
      "path": "ui/navigation-menu.tsx",
      "content": "\"use client\";\n\nimport { NavigationMenu as BaseNavigationMenu } from \"@base-ui/react/navigation-menu\";\nimport type { ReactNode } from \"react\";\n\ntype ClassName<State> = string | ((state: State) => string | undefined) | undefined;\n\nfunction cx(...classes: (string | false | null | undefined)[]) {\n  return classes.filter(Boolean).join(\" \");\n}\n\n/** Prepends base classes while keeping Base UI's state-function form of className working. */\nfunction withBase<State>(base: string, className: ClassName<State>) {\n  return typeof className === \"function\" ? (state: State) => cx(base, className(state)) : cx(base, className);\n}\n\n// One quint ease-out shared by the panel, its size, its position, and the sliding content.\nconst ease = \"ease-[cubic-bezier(0.22,1,0.36,1)]\";\n\ntype PositionerProps = BaseNavigationMenu.Positioner.Props;\n\nexport interface NavigationMenuProps extends BaseNavigationMenu.Root.Props {\n  /** Alignment of the dropdown panel against the open trigger. */\n  align?: PositionerProps[\"align\"];\n  /** Gap between the triggers and the panel, in pixels. */\n  sideOffset?: PositionerProps[\"sideOffset\"];\n  /** Classes for the floating panel. */\n  popupClassName?: string;\n  /** Element to portal the panel into. Defaults to `document.body`. */\n  container?: BaseNavigationMenu.Portal.Props[\"container\"];\n}\n\n/**\n * Site navigation with dropdown panels. Renders a `<nav>` with your `NavigationMenuList`, plus one\n * shared floating panel: it grows from the open trigger, then glides and resizes between triggers\n * while the content slides in from the side the pointer came from. All of it is removed with\n * reduced motion.\n */\nexport function NavigationMenu({\n  align = \"start\",\n  sideOffset = 8,\n  popupClassName,\n  container,\n  className,\n  children,\n  ...props\n}: NavigationMenuProps) {\n  return (\n    <BaseNavigationMenu.Root className={withBase(\"relative min-w-0\", className)} {...props}>\n      {children}\n      <BaseNavigationMenu.Portal container={container}>\n        <BaseNavigationMenu.Positioner\n          side=\"bottom\"\n          align={align}\n          sideOffset={sideOffset}\n          collisionPadding={12}\n          collisionAvoidance={{ side: \"none\" }}\n          className={cx(\n            \"z-50 h-(--positioner-height) w-(--positioner-width) max-w-(--available-width)\",\n            `transition-[top,left,right,bottom] duration-260 ${ease} motion-reduce:transition-none data-[instant]:transition-none`,\n            // A bridge across the gap, so moving the pointer from a trigger to the panel keeps it open.\n            \"before:absolute before:inset-x-0 before:-top-2 before:h-2 before:content-['']\",\n          )}\n        >\n          <BaseNavigationMenu.Popup\n            className={cx(\n              \"relative h-(--popup-height) w-(--popup-width) origin-(--transform-origin) overflow-hidden rounded-xl outline-none\",\n              \"border border-zinc-950/10 bg-white text-zinc-950 shadow-[0_12px_32px_-8px_rgb(0_0_0/0.18)]\",\n              \"dark:border-white/15 dark:bg-black dark:text-white dark:shadow-[0_16px_48px_-12px_rgb(0_0_0/1),inset_0_1px_0_rgb(255_255_255/0.08)]\",\n              // Size follows the active content; enter grows from the trigger, exit is a quicker fade.\n              `transition-[width,height,opacity,scale] duration-260 ${ease} motion-reduce:transition-none`,\n              \"data-[starting-style]:opacity-0 motion-safe:data-[starting-style]:scale-96\",\n              \"data-[ending-style]:opacity-0 data-[ending-style]:duration-110 data-[ending-style]:ease-out motion-safe:data-[ending-style]:scale-98\",\n              popupClassName,\n            )}\n          >\n            <BaseNavigationMenu.Viewport className=\"relative size-full overflow-hidden\" />\n          </BaseNavigationMenu.Popup>\n        </BaseNavigationMenu.Positioner>\n      </BaseNavigationMenu.Portal>\n    </BaseNavigationMenu.Root>\n  );\n}\n\n/** The row of top-level entries. */\nexport function NavigationMenuList({ className, ...props }: BaseNavigationMenu.List.Props) {\n  return <BaseNavigationMenu.List className={withBase(\"m-0 flex list-none items-center gap-0.5 p-0\", className)} {...props} />;\n}\n\n/** One top-level entry: a `NavigationMenuTrigger` with `NavigationMenuContent`, or a single `NavigationMenuLink`. */\nexport function NavigationMenuItem(props: BaseNavigationMenu.Item.Props) {\n  return <BaseNavigationMenu.Item {...props} />;\n}\n\nconst topLevel = cx(\n  \"group inline-flex h-8 items-center gap-1 rounded-lg px-3 text-sm font-medium whitespace-nowrap no-underline select-none\",\n  \"text-zinc-600 dark:text-zinc-400\",\n  \"transition-[background-color,color] duration-150 ease-out motion-reduce:transition-none\",\n  \"hover:bg-zinc-950/[0.04] hover:text-zinc-950 dark:hover:bg-white/[0.06] dark:hover:text-white\",\n  \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-500\",\n);\n\n/**\n * Opens its panel on hover and on click; Enter, Space, and ArrowDown open it from the keyboard, and\n * Tab moves on into the panel. The chevron turns while the panel is open.\n */\nexport function NavigationMenuTrigger({ className, children, ...props }: BaseNavigationMenu.Trigger.Props) {\n  return (\n    <BaseNavigationMenu.Trigger\n      className={withBase(\n        cx(\n          topLevel,\n          \"pr-2\",\n          \"data-[popup-open]:bg-zinc-950/[0.04] data-[popup-open]:text-zinc-950 dark:data-[popup-open]:bg-white/[0.06] dark:data-[popup-open]:text-white\",\n        ),\n        className,\n      )}\n      {...props}\n    >\n      {children}\n      <BaseNavigationMenu.Icon\n        className={cx(\n          \"inline-flex text-zinc-400 dark:text-zinc-500\",\n          `transition-[rotate,color] duration-200 ${ease} motion-reduce:transition-none`,\n          \"group-hover:text-zinc-600 data-[popup-open]:rotate-180 data-[popup-open]:text-zinc-600 dark:group-hover:text-zinc-300 dark:data-[popup-open]:text-zinc-300\",\n        )}\n      >\n        <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" fill=\"none\" className=\"size-3.5\">\n          <path d=\"m4.5 6.25 3.5 3.5 3.5-3.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n        </svg>\n      </BaseNavigationMenu.Icon>\n    </BaseNavigationMenu.Trigger>\n  );\n}\n\n/**\n * The panel content for a trigger. It slides a short distance in from the side of the trigger the\n * pointer moved toward while the previous content slides out the other way.\n */\nexport function NavigationMenuContent({ className, ...props }: BaseNavigationMenu.Content.Props) {\n  return (\n    <BaseNavigationMenu.Content\n      className={withBase(\n        cx(\n          \"h-full w-[calc(100vw-1.5rem)] p-2 sm:w-max\",\n          `transition-[opacity,translate] duration-260 ${ease} motion-reduce:transition-none`,\n          \"data-[starting-style]:opacity-0 data-[ending-style]:opacity-0 data-[ending-style]:duration-160\",\n          \"motion-safe:data-[starting-style]:data-[activation-direction=right]:translate-x-12\",\n          \"motion-safe:data-[starting-style]:data-[activation-direction=left]:-translate-x-12\",\n          \"motion-safe:data-[ending-style]:data-[activation-direction=right]:-translate-x-12\",\n          \"motion-safe:data-[ending-style]:data-[activation-direction=left]:translate-x-12\",\n        ),\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nexport interface NavigationMenuLinkProps extends BaseNavigationMenu.Link.Props {}\n\n/**\n * A top-level link with no panel. Pass `active` for the current section, which sets\n * `aria-current=\"page\"`, and `render={<Link href=\"…\" />}` for your router.\n */\nexport function NavigationMenuLink({ className, ...props }: NavigationMenuLinkProps) {\n  return (\n    <BaseNavigationMenu.Link\n      className={withBase(cx(topLevel, \"data-[active]:text-zinc-950 dark:data-[active]:text-white\"), className)}\n      {...props}\n    />\n  );\n}\n\nexport interface NavigationMenuPanelLinkProps extends Omit<BaseNavigationMenu.Link.Props, \"title\"> {\n  /** The link's name. */\n  title: ReactNode;\n  /** One line about where the link goes, in the secondary text color. */\n  description?: ReactNode;\n  /** A 16px icon shown in a hairline tile before the text. */\n  icon?: ReactNode;\n}\n\n/**\n * A link inside a panel with a title, an optional description, and an optional icon tile. Closes\n * the panel when followed. Hover and keyboard highlight only change the background tint.\n */\nexport function NavigationMenuPanelLink({ title, description, icon, className, closeOnClick = true, ...props }: NavigationMenuPanelLinkProps) {\n  return (\n    <BaseNavigationMenu.Link\n      closeOnClick={closeOnClick}\n      className={withBase(\n        cx(\n          \"group/link flex items-start gap-3 rounded-lg p-2.5 text-left no-underline outline-none\",\n          \"transition-[background-color] duration-150 ease-out motion-reduce:transition-none\",\n          \"hover:bg-zinc-950/[0.04] focus-visible:bg-zinc-950/[0.04] dark:hover:bg-white/[0.06] dark:focus-visible:bg-white/[0.06]\",\n          \"focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-sky-500\",\n          \"data-[active]:bg-zinc-950/[0.06] dark:data-[active]:bg-white/[0.09]\",\n        ),\n        className,\n      )}\n      {...props}\n    >\n      {icon ? (\n        <span\n          aria-hidden=\"true\"\n          className={cx(\n            \"flex size-8 shrink-0 items-center justify-center rounded-lg border text-zinc-600 [&_svg]:size-4\",\n            \"border-zinc-950/10 shadow-[0_1px_2px_rgb(0_0_0/0.04)] dark:border-white/15 dark:text-zinc-300 dark:shadow-none\",\n            \"transition-[color,border-color] duration-150 ease-out motion-reduce:transition-none\",\n            \"group-hover/link:border-zinc-950/20 group-hover/link:text-zinc-950 dark:group-hover/link:border-white/25 dark:group-hover/link:text-white\",\n          )}\n        >\n          {icon}\n        </span>\n      ) : null}\n      <span className=\"flex min-w-0 flex-col gap-0.5\">\n        <span className=\"text-sm leading-5 font-medium text-zinc-950 dark:text-white\">{title}</span>\n        {description ? <span className=\"text-[13px] leading-5 text-zinc-500 dark:text-zinc-400\">{description}</span> : null}\n      </span>\n    </BaseNavigationMenu.Link>\n  );\n}\n"
    }
  ],
  "example": {
    "content": "import {\n  NavigationMenu,\n  NavigationMenuContent,\n  NavigationMenuItem,\n  NavigationMenuLink,\n  NavigationMenuList,\n  NavigationMenuPanelLink,\n  NavigationMenuTrigger,\n} from \"@/components/shaken/ui/navigation-menu\";\n\nconst icon = { viewBox: \"0 0 16 16\", fill: \"none\" } as const;\nconst stroke = { stroke: \"currentColor\", strokeWidth: 1.5, strokeLinecap: \"round\", strokeLinejoin: \"round\" } as const;\n\nconst platform = [\n  {\n    title: \"Agents\",\n    description: \"Run coding agents against your repositories.\",\n    href: \"#agents\",\n    icon: (\n      <svg {...icon}>\n        <rect x=\"3\" y=\"4.5\" width=\"10\" height=\"8\" rx=\"2\" {...stroke} />\n        <path d=\"M8 2.5v2M6 8.25v.5M10 8.25v.5\" {...stroke} />\n      </svg>\n    ),\n  },\n  {\n    title: \"Approvals\",\n    description: \"Pause risky steps until a person signs off.\",\n    href: \"#approvals\",\n    icon: (\n      <svg {...icon}>\n        <circle cx=\"8\" cy=\"8\" r=\"5.25\" {...stroke} />\n        <path d=\"M6.6 6.1v3.8M9.4 6.1v3.8\" {...stroke} />\n      </svg>\n    ),\n  },\n  {\n    title: \"Traces\",\n    description: \"Inspect every model call, tool call, and token.\",\n    href: \"#traces\",\n    icon: (\n      <svg {...icon}>\n        <path d=\"M2.75 4h6.5M5 8h8.25M2.75 12h5\" {...stroke} />\n      </svg>\n    ),\n  },\n  {\n    title: \"Evaluations\",\n    description: \"Score agent runs against your own test sets.\",\n    href: \"#evaluations\",\n    icon: (\n      <svg {...icon}>\n        <path d=\"M2.75 13.25h10.5M4.5 10.5V8M8 10.5V4.5M11.5 10.5V6.5\" {...stroke} />\n      </svg>\n    ),\n  },\n];\n\nconst developers = [\n  { title: \"Quickstart\", description: \"Ship a first agent in ten minutes.\", href: \"#quickstart\" },\n  { title: \"API reference\", description: \"Endpoints, events, and error codes.\", href: \"#api\" },\n  { title: \"CLI\", description: \"Start and stream runs from a terminal.\", href: \"#cli\" },\n  { title: \"Changelog\", description: \"What changed in each release.\", href: \"#changelog\" },\n];\n\nexport default function NavigationMenuExample() {\n  return (\n    <div className=\"flex w-full max-w-3xl items-center gap-4 rounded-xl border border-zinc-950/10 bg-white px-3 py-2 dark:border-white/10 dark:bg-black\">\n      <span className=\"hidden pl-1 text-sm font-semibold text-zinc-950 sm:inline dark:text-white\">Northwind</span>\n      <NavigationMenu aria-label=\"Main\">\n        <NavigationMenuList>\n          <NavigationMenuItem>\n            <NavigationMenuTrigger>Platform</NavigationMenuTrigger>\n            <NavigationMenuContent>\n              <ul className=\"m-0 grid list-none gap-0.5 p-0 sm:w-[34rem] sm:grid-cols-2\">\n                {platform.map((link) => (\n                  <li key={link.href}>\n                    <NavigationMenuPanelLink href={link.href} title={link.title} description={link.description} icon={link.icon} />\n                  </li>\n                ))}\n              </ul>\n            </NavigationMenuContent>\n          </NavigationMenuItem>\n          <NavigationMenuItem>\n            <NavigationMenuTrigger>Developers</NavigationMenuTrigger>\n            <NavigationMenuContent>\n              <ul className=\"m-0 grid list-none gap-0.5 p-0 sm:w-80\">\n                {developers.map((link) => (\n                  <li key={link.href}>\n                    <NavigationMenuPanelLink href={link.href} title={link.title} description={link.description} />\n                  </li>\n                ))}\n              </ul>\n            </NavigationMenuContent>\n          </NavigationMenuItem>\n          <NavigationMenuItem>\n            <NavigationMenuLink href=\"#pricing\">Pricing</NavigationMenuLink>\n          </NavigationMenuItem>\n        </NavigationMenuList>\n      </NavigationMenu>\n    </div>\n  );\n}\n"
  }
}
