Install
Pull Menubar from the barrel for everyday use, or the granular path when you want a tighter bundle.
import { Menubar } from "@brika/clay";import { Menubar } from "@brika/clay/components/menubar";A minimal example
Drop this into a page. Native HTML attributes pass through to the underlying primitive.
import {
Menubar,
MenubarContent,
MenubarItem,
MenubarMenu,
MenubarSeparator,
MenubarShortcut,
MenubarSub,
MenubarSubContent,
MenubarSubTrigger,
MenubarTrigger,
} from '@brika/clay/components/menubar';
/** Application menu bar with File, Edit, and View menus. */
export default function MenubarDefaultDemo() {
return (
<Menubar>
<MenubarMenu>
<MenubarTrigger>File</MenubarTrigger>
<MenubarContent>
<MenubarItem>
New Tab <MenubarShortcut>⌘T</MenubarShortcut>
</MenubarItem>
<MenubarItem>
New Window <MenubarShortcut>⌘N</MenubarShortcut>
</MenubarItem>
<MenubarSeparator />
<MenubarSub>
<MenubarSubTrigger>Share</MenubarSubTrigger>
<MenubarSubContent>
<MenubarItem>Email link</MenubarItem>
<MenubarItem>Copy link</MenubarItem>
</MenubarSubContent>
</MenubarSub>
<MenubarSeparator />
<MenubarItem>
Close Window <MenubarShortcut>⌘W</MenubarShortcut>
</MenubarItem>
</MenubarContent>
</MenubarMenu>
<MenubarMenu>
<MenubarTrigger>Edit</MenubarTrigger>
<MenubarContent>
<MenubarItem>
Undo <MenubarShortcut>⌘Z</MenubarShortcut>
</MenubarItem>
<MenubarItem>
Redo <MenubarShortcut>⇧⌘Z</MenubarShortcut>
</MenubarItem>
<MenubarSeparator />
<MenubarItem>
Find <MenubarShortcut>⌘F</MenubarShortcut>
</MenubarItem>
</MenubarContent>
</MenubarMenu>
<MenubarMenu>
<MenubarTrigger>View</MenubarTrigger>
<MenubarContent>
<MenubarItem>Toggle Sidebar</MenubarItem>
<MenubarSeparator />
<MenubarItem>
Full Screen <MenubarShortcut>⌃⌘F</MenubarShortcut>
</MenubarItem>
</MenubarContent>
</MenubarMenu>
</Menubar>
);
}Menubar, every way
Full
Checkbox items for toggled settings and radio items for mutually exclusive options.
Accessibility
- Arrow keys navigate between top-level triggers; Enter/Space opens the dropdown.
- Escape closes the open dropdown; Tab moves focus outside the menubar entirely.
- Each
MenubarMenuis arole="menu"with its trigger asrole="menuitem". - Keyboard shortcuts shown in items are visual only, implement the actual shortcuts separately.
Theme tokens
Every CSS variable Menubar reads, with its default and the
dotted path you'd write in a ThemeConfig JSON
to override it. Set any of these in your theme to retune Menubar
without touching component code.
Menubar tokens
10 tokens--menubar-containercolorvar(--background)components.menubar.containerBackground of the menubar root rail.
--menubar-border-colorcolorvar(--input)components.menubar.borderColorBorder color of the menubar root rail.
--menubar-radiusradiusvar(--radius-control)components.menubar.radiusMenubar root border radius.
--menubar-heightsize2.25remcomponents.menubar.heightDefault menubar height.
--menubar-padding-xsizecalc(var(--spacing) * 1.5)components.menubar.paddingXInline padding inside the menubar.
--menubar-padding-ysizecalc(var(--spacing) * 1)components.menubar.paddingYBlock padding inside the menubar.
--menubar-border-widthborder-width1pxcomponents.menubar.borderWidthBorder width on the menubar. Set non-zero for outline-style variants.
--menubar-border-styleborder-stylesolidcomponents.menubar.borderStyleBorder style on the menubar (`solid`, `dashed`, `double`, `none`).
--menubar-durationdurationvar(--motion-standard-duration)components.menubar.durationTransition duration for menubar state changes.
--menubar-easingeasingvar(--motion-standard-easing)components.menubar.easingTransition easing for menubar state changes.
Override in a theme
Authoring a theme is plain JSON. Drop overrides under
components.menubar, the names
are camelCase versions of the variable suffix.
{
"id": "my-theme",
"name": "My Theme",
"description": "...",
"accentSwatches": ["#000"],
"components": {
"menubar": {
"paddingX": "calc(var(--spacing) * 1.5)"
}
}
}
Then apply with applyTheme(myTheme)
(see the theming guide),
scope it to a subtree with themeToCssVars(myTheme, mode),
or consume any token directly in your own JSX with the matching Tailwind utility
(e.g. bg-menubar-…) — see the
chips on each token row.
API reference
Props specific to Menubar. Native HTML attributes pass through to the underlying primitive, see the component source on GitHub for the full type signature.
<Menubar />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<MenubarCheckboxItem />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<MenubarContent />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<MenubarGroup />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<MenubarItem />
2 props- booleanWhen
true, adds extra leading padding to align with icon items. - variantdefault
'default''default' | 'destructive'"default"or"destructive", destructive renders in red.
<MenubarLabel />
1 prop- boolean
No description.
<MenubarMenu />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<MenubarPortal />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<MenubarRadioGroup />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<MenubarRadioItem />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<MenubarSeparator />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<MenubarShortcut />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<MenubarSub />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<MenubarSubContent />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<MenubarSubTrigger />
1 prop- boolean
No description.
<MenubarTrigger />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.