Menubar
Horizontal application menu bar (File / Edit / View). Wraps Radix Menubar Root;
compose with MenubarMenu for each top-level menu. Which menu is open is
uncontrolled by default; pass value/onValueChange to control it.
Usage
import { Menubar, menubarAnatomy, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger } from "@desk/ui/components/menubar";Best practices
Reserve
Menubarfor a persistent desktop app menu bar; a single click menu isDropdownMenu, a right-click menu isContextMenu.Give each top-level label its own
MenubarMenu, and leave which menu is open uncontrolled unless you must drive it viavalue.
Props
MenubarCheckboxItem
| Prop | Type | Default | Description |
|---|---|---|---|
| children | string | number | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Text label. Use |
MenubarContent
| Prop | Type | Default | Description |
|---|---|---|---|
| size | "base" | "2xs" | "xs" | "sm" | "lg" | "xl" | "2xl" | "3xl" | ||
| itemRadius | "rounded" | "square" | "full" | Border radius for menu items. When "full", items become pill-shaped. | |
| surface | MenuSurface | Surface density. Compact maps to the 16px-radius, 4px-padding menu surface. | |
| contentWidth | MenuContentWidth | Named content widths from the design system. | |
| overflow | MenuOverflow | Outer content overflow behavior. Use hidden when a child owns scrolling. |
MenubarItem
| Prop | Type | Default | Description |
|---|---|---|---|
| inset | boolean | ||
| tone | "neutral" | "danger" | ||
| avatar | React.ReactNode | ||
| dot | boolean | "neutral" | "brand" | "danger" | "warning" | "success" | "info" | Dot indicator at the start (takes precedence over icon): | |
| icon | LucideIcon | React.ComponentType<React.SVGProps<SVGSVGElement>> | ||
| suffixIcon | LucideIcon | React.ComponentType<React.SVGProps<SVGSVGElement>> | ||
| kbd | string[] | ||
| suffix | React.ReactNode | ||
| active | boolean | Whether the item is in an active/selected state | |
| activeIndicator | "none" | "dot" | "check" | Visual indicator for active state. "dot" shows grey dot normally, green when active. "check" shows green checkmark only when active. | |
| children | string | number | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Text label. Use |
MenubarLabel
| Prop | Type | Default | Description |
|---|---|---|---|
| inset | boolean |
MenubarRadioItem
| Prop | Type | Default | Description |
|---|---|---|---|
| children | string | number | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Text label. Use |
MenubarSeparator
| Prop | Type | Default | Description |
|---|---|---|---|
| spacing | MenubarSeparatorSpacing |
MenubarSubContent
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | ||
| size | "base" | "2xs" | "xs" | "sm" | "lg" | "xl" | "2xl" | "3xl" | ||
| children | ReactNode |
MenubarSubTrigger
| Prop | Type | Default | Description |
|---|---|---|---|
| inset | boolean | ||
| icon | LucideIcon | React.ComponentType<React.SVGProps<SVGSVGElement>> | ||
| children | string | number | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Text label. Use |
Also exports
- component
Menubar - const
menubarAnatomy - component
MenubarGroup - component
MenubarMenu - component
MenubarPortal - component
MenubarRadioGroup - component
MenubarShortcut - component
MenubarSub - component
MenubarTrigger
Anatomy
Menubar
menubarHorizontal application menu bar (File / Edit / View)
MenubarMenu
menubar-menuA single top-level menu
MenubarTrigger
menubar-triggerButton opening a top-level menu
MenubarContent
menubar-contentMenu content container
MenubarItem
menubar-itemMenu item
MenubarCheckboxItem
menubar-checkbox-itemToggleable item
MenubarRadioGroup
menubar-radio-groupExclusive selection group
MenubarRadioItem
menubar-radio-itemRadio option
MenubarLabel
menubar-labelSection label
MenubarSeparator
menubar-separatorVisual divider
MenubarSub
menubar-subNested submenu
MenubarSubTrigger
menubar-sub-triggerOpens nested menu
MenubarSubContent
menubar-sub-contentNested menu container
MenubarShortcut
menubar-shortcutKeyboard shortcut