{
"$schema": "https://blode.co/ui/schema/registry-item.json",
"name": "menubar",
"title": "Menubar",
"author": "Matthew Blode",
"description": "A horizontal menu bar with dropdown menus, commonly used for application navigation.",
"dependencies": ["@base-ui/react"],
"files": [
{
"path": "ui/menubar.tsx",
"content": "\"use client\";\n\nimport { Menu as MenuPrimitive } from \"@base-ui/react/menu\";\nimport { Menubar as MenubarPrimitive } from \"@base-ui/react/menubar\";\nimport { CheckIcon, ChevronRightIcon } from \"blode-icons-react\";\nimport * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst Menubar = ({ className, ...props }: MenubarPrimitive.Props) => (\n \n);\n\nconst MenubarMenu = ({ ...props }: MenuPrimitive.Root.Props) => (\n \n);\n\nconst MenubarGroup = ({ ...props }: MenuPrimitive.Group.Props) => (\n \n);\n\nconst MenubarPortal = ({ ...props }: MenuPrimitive.Portal.Props) => (\n \n);\n\nconst MenubarRadioGroup = ({ ...props }: MenuPrimitive.RadioGroup.Props) => (\n \n);\n\nconst MenubarTrigger = ({\n className,\n asChild,\n children,\n ...props\n}: MenuPrimitive.Trigger.Props & {\n asChild?: boolean;\n}) => {\n if (asChild && React.isValidElement(children)) {\n return (\n \n );\n }\n\n return (\n \n {children}\n \n );\n};\n\nconst MenubarContent = ({\n className,\n align = \"start\",\n alignOffset = -4,\n sideOffset = 8,\n ...props\n}: MenuPrimitive.Popup.Props &\n Pick) => (\n \n \n \n \n \n);\n\nconst MenubarItem = ({\n className,\n inset,\n variant = \"default\",\n asChild,\n children,\n ...props\n}: MenuPrimitive.Item.Props & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n asChild?: boolean;\n}) => {\n if (asChild && React.isValidElement(children)) {\n return (\n \n );\n }\n\n return (\n \n {children}\n \n );\n};\n\ntype MenubarCheckedState = boolean | \"indeterminate\";\n\ntype MenubarCheckboxItemProps = Omit<\n MenuPrimitive.CheckboxItem.Props,\n \"checked\" | \"defaultChecked\" | \"onCheckedChange\"\n> & {\n checked?: MenubarCheckedState;\n defaultChecked?: MenubarCheckedState;\n onCheckedChange?: (\n checked: MenubarCheckedState,\n eventDetails: MenuPrimitive.CheckboxItem.ChangeEventDetails,\n ) => void;\n inset?: boolean;\n};\n\nconst MenubarCheckboxItem = ({\n className,\n children,\n checked,\n defaultChecked,\n onCheckedChange,\n inset,\n ...props\n}: MenubarCheckboxItemProps) => (\n onCheckedChange?.(value, eventDetails)}\n {...props}\n >\n \n \n \n \n \n {children}\n \n);\n\nconst MenubarRadioItem = ({\n className,\n children,\n inset,\n ...props\n}: MenuPrimitive.RadioItem.Props & {\n inset?: boolean;\n}) => (\n \n \n \n \n \n \n {children}\n \n);\n\nconst MenubarLabel = ({\n className,\n inset,\n ...props\n}: MenuPrimitive.GroupLabel.Props & {\n inset?: boolean;\n}) => (\n \n);\n\nconst MenubarSeparator = ({ className, ...props }: MenuPrimitive.Separator.Props) => (\n \n);\n\nconst MenubarShortcut = ({ className, ...props }: React.ComponentProps<\"span\">) => (\n \n);\n\nconst MenubarSub = ({ ...props }: MenuPrimitive.SubmenuRoot.Props) => (\n \n);\n\nconst MenubarSubTrigger = ({\n className,\n inset,\n children,\n ...props\n}: MenuPrimitive.SubmenuTrigger.Props & {\n inset?: boolean;\n}) => (\n \n {children}\n \n \n);\n\nconst MenubarSubContent = ({\n className,\n align = \"start\",\n alignOffset = -3,\n side = \"right\",\n sideOffset = 0,\n ...props\n}: MenuPrimitive.Popup.Props &\n Pick) => (\n \n \n \n \n \n);\n\nexport {\n Menubar,\n MenubarPortal,\n MenubarMenu,\n MenubarTrigger,\n MenubarContent,\n MenubarGroup,\n MenubarSeparator,\n MenubarLabel,\n MenubarItem,\n MenubarShortcut,\n MenubarCheckboxItem,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarSub,\n MenubarSubTrigger,\n MenubarSubContent,\n};\n",
"type": "registry:ui",
"target": ""
}
],
"type": "registry:ui"
}