menubar.json — ui Source File
Architecture documentation for menubar.json, a json file in the ui codebase.
Entity Profile
Source Code
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "menubar",
"registryDependencies": [
"dropdown-menu"
],
"files": [
{
"path": "registry/base-maia/ui/menubar.tsx",
"content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Menu as MenuPrimitive } from \"@base-ui/react/menu\"\nimport { Menubar as MenubarPrimitive } from \"@base-ui/react/menubar\"\n\nimport { cn } from \"@/registry/base-maia/lib/utils\"\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from \"@/registry/base-maia/ui/dropdown-menu\"\nimport { IconPlaceholder } from \"@/app/(create)/components/icon-placeholder\"\n\nfunction Menubar({ className, ...props }: MenubarPrimitive.Props) {\n return (\n <MenubarPrimitive\n data-slot=\"menubar\"\n className={cn(\"bg-background h-9 rounded-2xl border p-1 flex items-center\", className)}\n {...props}\n />\n )\n}\n\nfunction MenubarMenu({ ...props }: React.ComponentProps<typeof DropdownMenu>) {\n return <DropdownMenu data-slot=\"menubar-menu\" {...props} />\n}\n\nfunction MenubarGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuGroup>) {\n return <DropdownMenuGroup data-slot=\"menubar-group\" {...props} />\n}\n\nfunction MenubarPortal({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPortal>) {\n return <DropdownMenuPortal data-slot=\"menubar-portal\" {...props} />\n}\n\nfunction MenubarTrigger({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuTrigger>) {\n return (\n <DropdownMenuTrigger\n data-slot=\"menubar-trigger\"\n className={cn(\n \"hover:bg-muted aria-expanded:bg-muted rounded-xl px-2.5 py-1 text-sm font-medium flex items-center outline-hidden select-none\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction MenubarContent({\n className,\n align = \"start\",\n alignOffset = -4,\n sideOffset = 8,\n ...props\n}: React.ComponentProps<typeof DropdownMenuContent>) {\n return (\n <DropdownMenuContent\n data-slot=\"menubar-content\"\n align={align}\n alignOffset={alignOffset}\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/5 min-w-48 rounded-2xl p-1 shadow-2xl ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 cn-menu-target\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction MenubarItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof DropdownMenuItem>) {\n return (\n <DropdownMenuItem\n data-slot=\"menubar-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive! not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2.5 rounded-xl px-3 py-2 text-sm data-disabled:opacity-50 data-inset:pl-9.5 [&_svg:not([class*='size-'])]:size-4 group/menubar-item\", className)}\n {...props}\n />\n )\n}\n\nfunction MenubarCheckboxItem({\n className,\n children,\n checked,\n inset,\n ...props\n}: MenuPrimitive.CheckboxItem.Props & {\n inset?: boolean\n}) {\n return (\n <MenuPrimitive.CheckboxItem\n data-slot=\"menubar-checkbox-item\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2.5 rounded-xl py-2 pr-3 pl-9.5 text-sm data-inset:pl-9.5 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"left-3 size-4 [&_svg:not([class*='size-'])]:size-4 pointer-events-none absolute flex items-center justify-center\">\n <MenuPrimitive.CheckboxItemIndicator>\n <IconPlaceholder\n lucide=\"CheckIcon\"\n tabler=\"IconCheck\"\n hugeicons=\"Tick02Icon\"\n phosphor=\"CheckIcon\"\n remixicon=\"RiCheckLine\"\n />\n </MenuPrimitive.CheckboxItemIndicator>\n </span>\n {children}\n </MenuPrimitive.CheckboxItem>\n )\n}\n\nfunction MenubarRadioGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuRadioGroup>) {\n return <DropdownMenuRadioGroup data-slot=\"menubar-radio-group\" {...props} />\n}\n\nfunction MenubarRadioItem({\n className,\n children,\n inset,\n ...props\n}: MenuPrimitive.RadioItem.Props & {\n inset?: boolean\n}) {\n return (\n <MenuPrimitive.RadioItem\n data-slot=\"menubar-radio-item\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2.5 rounded-xl py-2 pr-3 pl-9.5 text-sm data-disabled:opacity-50 data-inset:pl-9.5 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n className\n )}\n {...props}\n >\n <span className=\"left-3 size-4 [&_svg:not([class*='size-'])]:size-4 pointer-events-none absolute flex items-center justify-center\">\n <MenuPrimitive.RadioItemIndicator>\n <IconPlaceholder\n lucide=\"CheckIcon\"\n tabler=\"IconCheck\"\n hugeicons=\"Tick02Icon\"\n phosphor=\"CheckIcon\"\n remixicon=\"RiCheckLine\"\n />\n </MenuPrimitive.RadioItemIndicator>\n </span>\n {children}\n </MenuPrimitive.RadioItem>\n )\n}\n\nfunction MenubarLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuLabel> & {\n inset?: boolean\n}) {\n return (\n <DropdownMenuLabel\n data-slot=\"menubar-label\"\n data-inset={inset}\n className={cn(\"text-muted-foreground px-3.5 py-2.5 text-xs data-inset:pl-9.5\", className)}\n {...props}\n />\n )\n}\n\nfunction MenubarSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuSeparator>) {\n return (\n <DropdownMenuSeparator\n data-slot=\"menubar-separator\"\n className={cn(\"bg-border/50 -mx-1 my-1 h-px\", className)}\n {...props}\n />\n )\n}\n\nfunction MenubarShortcut({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuShortcut>) {\n return (\n <DropdownMenuShortcut\n data-slot=\"menubar-shortcut\"\n className={cn(\"text-muted-foreground group-focus/menubar-item:text-accent-foreground text-xs tracking-widest ml-auto\", className)}\n {...props}\n />\n )\n}\n\nfunction MenubarSub({\n ...props\n}: React.ComponentProps<typeof DropdownMenuSub>) {\n return <DropdownMenuSub data-slot=\"menubar-sub\" {...props} />\n}\n\nfunction MenubarSubTrigger({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuSubTrigger> & {\n inset?: boolean\n}) {\n return (\n <DropdownMenuSubTrigger\n data-slot=\"menubar-sub-trigger\"\n data-inset={inset}\n className={cn(\"focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground gap-2 rounded-xl px-3 py-2 text-sm data-inset:pl-9.5 [&_svg:not([class*='size-'])]:size-4\", className)}\n {...props}\n />\n )\n}\n\nfunction MenubarSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuSubContent>) {\n return (\n <DropdownMenuSubContent\n data-slot=\"menubar-sub-content\"\n className={cn(\"bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/5 min-w-32 rounded-2xl p-1 shadow-2xl ring-1 duration-100\", className)}\n {...props}\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"
}
],
"type": "registry:ui"
}
Source
Frequently Asked Questions
What does menubar.json do?
menubar.json is a source file in the ui codebase, written in json.
Where is menubar.json in the architecture?
menubar.json is located at apps/v4/public/r/styles/base-maia/menubar.json (directory: apps/v4/public/r/styles/base-maia).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free