{
  "schemaVersion": 1,
  "target": "react",
  "name": "menubar",
  "version": "0.1.1",
  "category": "overlays",
  "title": "Menubar",
  "description": "An application menubar with File, Edit, and View style menus, submenus, checkbox and radio items, and shortcuts, built on Base UI Menubar with the Dropdown Menu surface.",
  "tags": [
    "overlay",
    "menu",
    "menubar",
    "app-shell",
    "base-ui"
  ],
  "requires": {
    "projectTypes": [
      "next",
      "vite-react"
    ],
    "styling": "tailwind-v4"
  },
  "npmDependencies": {
    "@base-ui/react": "^1.9.0"
  },
  "registryDependencies": [
    {
      "name": "dropdown-menu",
      "version": "0.2.1"
    },
    {
      "name": "context-menu",
      "version": "0.1.1"
    }
  ],
  "docsPath": "/components/menubar",
  "props": [
    {
      "name": "Menubar orientation",
      "type": "\"horizontal\" | \"vertical\"",
      "default": "\"horizontal\"",
      "description": "Which arrow keys move between menus."
    },
    {
      "name": "Menubar loopFocus",
      "type": "boolean",
      "default": "true",
      "description": "Wraps arrow-key focus from the last menu to the first."
    },
    {
      "name": "Menubar disabled",
      "type": "boolean",
      "default": "false",
      "description": "Disables every menu in the bar."
    },
    {
      "name": "MenubarMenu",
      "type": "Base UI Menu.Root props",
      "description": "One menu: a MenubarTrigger and its MenubarContent."
    },
    {
      "name": "MenubarTrigger",
      "type": "Base UI Menu.Trigger props",
      "description": "The label in the bar, such as File. Tinted while its menu is open."
    },
    {
      "name": "MenubarContent side / align / sideOffset / alignOffset",
      "type": "Dropdown Menu content props",
      "default": "\"bottom\" / \"start\" / 6 / -4",
      "description": "Placement under the trigger."
    },
    {
      "name": "MenubarItem / MenubarCheckboxItem / MenubarRadioGroup / MenubarRadioItem",
      "type": "Dropdown Menu and Context Menu item props",
      "description": "Actions, toggles, and single choices, with destructive and disabled states."
    },
    {
      "name": "MenubarSub / MenubarSubTrigger / MenubarSubContent",
      "type": "Context Menu submenu parts",
      "description": "Nested menus beside their trigger."
    },
    {
      "name": "MenubarGroup / MenubarLabel / MenubarSeparator / MenubarShortcut",
      "type": "Dropdown Menu parts",
      "description": "Grouping, labels, dividers, and shortcut hints."
    }
  ],
  "accessibility": [
    "The bar has role=\"menubar\" and its triggers are menuitems with aria-haspopup and aria-expanded.",
    "Left and right arrows move between triggers; Enter, Space, or the down arrow opens a menu with its first item highlighted.",
    "While a menu is open, the left and right arrows and hovering another trigger switch menus; the swap is instant with no animation.",
    "Inside a menu, arrows, Home, End, and typeahead move the highlight; Escape closes the menu and returns focus to its trigger.",
    "Checkbox and radio items announce their state with aria-checked; disabled items stay reachable.",
    "With reduced motion the menu transitions are removed."
  ],
  "states": [
    "closed",
    "open",
    "submenu open"
  ],
  "files": [
    {
      "path": "ui/menubar.tsx",
      "content": "\"use client\";\n\nimport { Menu as BaseMenu } from \"@base-ui/react/menu\";\nimport { Menubar as BaseMenubar } from \"@base-ui/react/menubar\";\nimport {\n  ContextMenuCheckboxItem,\n  ContextMenuRadioGroup,\n  ContextMenuRadioItem,\n  ContextMenuSub,\n  ContextMenuSubContent,\n  ContextMenuSubTrigger,\n} from \"./context-menu\";\nimport {\n  DropdownMenuContent,\n  type DropdownMenuContentProps,\n  DropdownMenuGroup,\n  DropdownMenuItem,\n  DropdownMenuLabel,\n  DropdownMenuSeparator,\n  DropdownMenuShortcut,\n} from \"./dropdown-menu\";\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/**\n * The bar that holds the menus. Left and right arrows move between menu triggers, and once one\n * menu is open, hovering or arrowing to the next trigger opens that menu instead.\n */\nexport function Menubar({ className, ...props }: BaseMenubar.Props) {\n  return (\n    <BaseMenubar\n      className={withBase(\n        cx(\n          \"flex h-10 items-center gap-0.5 rounded-xl border border-zinc-950/10 bg-white p-1 text-zinc-950\",\n          \"shadow-[0_1px_2px_rgb(0_0_0/0.04)] dark:border-white/10 dark:bg-black dark:text-white dark:shadow-[inset_0_1px_0_rgb(255_255_255/0.06)]\",\n        ),\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\n/** One menu in the bar: a MenubarTrigger and its MenubarContent. */\nexport const MenubarMenu = BaseMenu.Root;\n\n/** The label in the bar that opens a menu, such as File or Edit. */\nexport function MenubarTrigger({ className, ...props }: BaseMenu.Trigger.Props) {\n  return (\n    <BaseMenu.Trigger\n      className={withBase(\n        cx(\n          \"inline-flex h-8 cursor-default items-center rounded-lg px-2.5 text-sm font-medium text-zinc-700 outline-none select-none\",\n          // Colors only: moving between menus is quick and frequent, so nothing slides.\n          \"transition-colors duration-150 ease-out motion-reduce:transition-none\",\n          \"hover:bg-zinc-950/[0.04] hover:text-zinc-950 data-[popup-open]:bg-zinc-950/[0.06] data-[popup-open]:text-zinc-950\",\n          \"dark:text-zinc-300 dark:hover:bg-white/[0.06] dark:hover:text-white dark:data-[popup-open]:bg-white/[0.09] dark:data-[popup-open]:text-white\",\n          \"focus-visible:outline-2 focus-visible:outline-solid focus-visible:-outline-offset-2 focus-visible:outline-sky-500\",\n          \"data-[disabled]:pointer-events-none data-[disabled]:opacity-45\",\n        ),\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nexport interface MenubarContentProps extends DropdownMenuContentProps {}\n\n/**\n * A menu's panel. Shares its surface with Dropdown Menu. When focus moves from one open menu to\n * the next, the swap is instant rather than animated.\n */\nexport function MenubarContent({ sideOffset = 6, alignOffset = -4, className, ...props }: MenubarContentProps) {\n  return (\n    <DropdownMenuContent\n      sideOffset={sideOffset}\n      alignOffset={alignOffset}\n      className={withBase(\"data-[instant]:transition-none\", className)}\n      {...props}\n    />\n  );\n}\n\n/** An action. `destructive` styles it for deleting; `disabled` keeps it visible but skips it. */\nexport const MenubarItem = DropdownMenuItem;\n\n/** Groups related items. Put a MenubarLabel inside to name the group. */\nexport const MenubarGroup = DropdownMenuGroup;\n\n/** Names a MenubarGroup or MenubarRadioGroup. Must be rendered inside the group it labels. */\nexport const MenubarLabel = DropdownMenuLabel;\n\n/** A divider between groups of items. */\nexport const MenubarSeparator = DropdownMenuSeparator;\n\n/** A keyboard shortcut hint shown at the end of an item. */\nexport const MenubarShortcut = DropdownMenuShortcut;\n\n/** An item that toggles a setting, with a check in the leading slot when on. */\nexport const MenubarCheckboxItem = ContextMenuCheckboxItem;\n\n/** Groups radio items so exactly one is chosen. */\nexport const MenubarRadioGroup = ContextMenuRadioGroup;\n\n/** One choice in a MenubarRadioGroup. */\nexport const MenubarRadioItem = ContextMenuRadioItem;\n\n/** Groups a submenu trigger with its panel. */\nexport const MenubarSub = ContextMenuSub;\n\n/** An item that opens a submenu on hover, click, or the right arrow key. */\nexport const MenubarSubTrigger = ContextMenuSubTrigger;\n\n/** The submenu panel, beside its trigger. */\nexport const MenubarSubContent = ContextMenuSubContent;\n"
    }
  ],
  "example": {
    "content": "\"use client\";\n\nimport { useState } from \"react\";\nimport {\n  Menubar,\n  MenubarCheckboxItem,\n  MenubarContent,\n  MenubarGroup,\n  MenubarItem,\n  MenubarLabel,\n  MenubarMenu,\n  MenubarRadioGroup,\n  MenubarRadioItem,\n  MenubarSeparator,\n  MenubarShortcut,\n  MenubarSub,\n  MenubarSubContent,\n  MenubarSubTrigger,\n  MenubarTrigger,\n} from \"@/components/shaken/ui/menubar\";\n\nconst recent = [\"acme-web\", \"agent-runtime\", \"billing-service\"];\n\nexport default function MenubarExample() {\n  const [wordWrap, setWordWrap] = useState(true);\n  const [minimap, setMinimap] = useState(false);\n  const [panel, setPanel] = useState(\"bottom\");\n\n  return (\n    <Menubar>\n      <MenubarMenu>\n        <MenubarTrigger>File</MenubarTrigger>\n        <MenubarContent>\n          <MenubarItem>\n            New file\n            <MenubarShortcut>⌘N</MenubarShortcut>\n          </MenubarItem>\n          <MenubarItem>\n            Open…\n            <MenubarShortcut>⌘O</MenubarShortcut>\n          </MenubarItem>\n          <MenubarSub>\n            <MenubarSubTrigger>Open recent</MenubarSubTrigger>\n            <MenubarSubContent>\n              {recent.map((name) => (\n                <MenubarItem key={name}>\n                  <span className=\"font-mono text-xs\">{name}</span>\n                </MenubarItem>\n              ))}\n              <MenubarSeparator />\n              <MenubarItem>Clear recent</MenubarItem>\n            </MenubarSubContent>\n          </MenubarSub>\n          <MenubarSeparator />\n          <MenubarItem>\n            Save\n            <MenubarShortcut>⌘S</MenubarShortcut>\n          </MenubarItem>\n          <MenubarItem disabled>\n            Save all\n            <MenubarShortcut>⌥⌘S</MenubarShortcut>\n          </MenubarItem>\n          <MenubarSeparator />\n          <MenubarItem destructive>Close workspace</MenubarItem>\n        </MenubarContent>\n      </MenubarMenu>\n\n      <MenubarMenu>\n        <MenubarTrigger>Edit</MenubarTrigger>\n        <MenubarContent>\n          <MenubarItem>\n            Undo\n            <MenubarShortcut>⌘Z</MenubarShortcut>\n          </MenubarItem>\n          <MenubarItem>\n            Redo\n            <MenubarShortcut>⇧⌘Z</MenubarShortcut>\n          </MenubarItem>\n          <MenubarSeparator />\n          <MenubarItem>\n            Find\n            <MenubarShortcut>⌘F</MenubarShortcut>\n          </MenubarItem>\n          <MenubarItem>\n            Replace\n            <MenubarShortcut>⌥⌘F</MenubarShortcut>\n          </MenubarItem>\n        </MenubarContent>\n      </MenubarMenu>\n\n      <MenubarMenu>\n        <MenubarTrigger>View</MenubarTrigger>\n        <MenubarContent>\n          <MenubarCheckboxItem checked={wordWrap} onCheckedChange={setWordWrap}>\n            Word wrap\n            <MenubarShortcut>⌥Z</MenubarShortcut>\n          </MenubarCheckboxItem>\n          <MenubarCheckboxItem checked={minimap} onCheckedChange={setMinimap}>\n            Minimap\n          </MenubarCheckboxItem>\n          <MenubarSeparator />\n          <MenubarRadioGroup value={panel} onValueChange={setPanel}>\n            <MenubarLabel>Panel position</MenubarLabel>\n            <MenubarRadioItem value=\"bottom\">Bottom</MenubarRadioItem>\n            <MenubarRadioItem value=\"right\">Right</MenubarRadioItem>\n            <MenubarRadioItem value=\"hidden\">Hidden</MenubarRadioItem>\n          </MenubarRadioGroup>\n        </MenubarContent>\n      </MenubarMenu>\n\n      <MenubarMenu>\n        <MenubarTrigger>Agent</MenubarTrigger>\n        <MenubarContent>\n          <MenubarGroup>\n            <MenubarItem>\n              Start run\n              <MenubarShortcut>⌘R</MenubarShortcut>\n            </MenubarItem>\n            <MenubarItem disabled>\n              Stop run\n              <MenubarShortcut>⌘.</MenubarShortcut>\n            </MenubarItem>\n            <MenubarItem>Review pending approvals</MenubarItem>\n          </MenubarGroup>\n          <MenubarSeparator />\n          <MenubarItem>Open trace</MenubarItem>\n        </MenubarContent>\n      </MenubarMenu>\n    </Menubar>\n  );\n}\n"
  }
}
