Menubar
A desktop-style menu bar. Once a menu is open, hover the others and the highlight slides along with you.
NavigationRadix Menubar
1export async function deploy(project: string) {2 const build = await createBuild(project)3 await build.wait()4 return promote(build.id)5}
Playground
Tweak the props, the preview and the code follow.
Props
<Menubar>
<MenubarMenu>
<MenubarTrigger>File</MenubarTrigger>
<MenubarContent>
<MenubarItem>
New tab <MenubarShortcut>⌘T</MenubarShortcut>
</MenubarItem>
</MenubarContent>
</MenubarMenu>
<MenubarMenu>
<MenubarTrigger>View</MenubarTrigger>
<MenubarContent>
<MenubarCheckboxItem checked={bookmarks} onCheckedChange={setBookmarks}>
Show bookmarks
</MenubarCheckboxItem>
</MenubarContent>
</MenubarMenu>
</Menubar>Installation
npx @plumsydev/plum-ui add menubarUsage
import {
Menubar,
MenubarContent,
MenubarItem,
MenubarMenu,
MenubarShortcut,
MenubarTrigger,
} from "@/components/ui/menubar"<Menubar>
<MenubarMenu>
<MenubarTrigger>File</MenubarTrigger>
<MenubarContent>
<MenubarItem>
New tab <MenubarShortcut>⌘T</MenubarShortcut>
</MenubarItem>
</MenubarContent>
</MenubarMenu>
</Menubar>Examples
Media controls
Checkbox and radio items drive the player: shuffle, repeat and playback speed.
Shipping Season — Ep. 42
1×
Workspace switcher
The trigger label follows the radio selection.
API Reference
Menubar
| Prop | Type | Default |
|---|---|---|
valueControlled open menu. | string | — |
onValueChangeCalled when a menu opens or closes. | (value: string) => void | — |
loopArrow keys wrap around the bar. | boolean | true |
MenubarItem
| Prop | Type | Default |
|---|---|---|
variantDestructive items are tinted red. | "default" | "destructive" | "default" |
insetAligns the label with checkbox and radio items. | boolean | — |
Notes
- Also exports
MenubarCheckboxItem,MenubarRadioGroup,MenubarRadioItem,MenubarSub,MenubarSubTrigger,MenubarSubContent,MenubarLabelandMenubarSeparator.