Menubar

React desktop-style horizontal menu bar built on Radix, with nested menus, checkbox and radio items, and outline triggers. Arrow keys move across and within menus.

Menubar is the File / Edit / View pattern. Each MenubarMenu holds a trigger and a menu of items; arrow keys move across and within menus.

When to use

Use Menubar in dense desktop tools such as document editors or back-office consoles where users expect File, Edit, and View style menus. For a single action menu, use DropdownMenu. For primary site navigation, use Sidebar or SlideoutMenu.

Examples

File / Edit / View

Checkboxes & radio group

Outline triggers (Arabic)

Props

Props declared by Menubar. Native attributes of the underlying element pass through.

<Menubar>

PropTypeDefaultDescription
valuestring
defaultValuestring
onValueChange(value: string) => void
loopboolean
dirDirection
asChildboolean

<MenubarMenu>

PropTypeDefaultDescription
__scopeMenubar_radix_ui_react_context.Scope
valuestring
childrenReactNode

<MenubarTrigger>

PropTypeDefaultDescription
variant"outline" | "default"
asChildboolean

<MenubarContent>

PropTypeDefaultDescription
size"sm" | "md"
forceMounttrueUsed to force mounting when more control is needed. Useful when controlling animation with React animation libraries.
onCloseAutoFocus(event: Event) => voidEvent handler called when auto-focusing on close. Can be prevented.
loopbooleanfalseWhether keyboard navigation should loop around
onEscapeKeyDown(event: KeyboardEvent) => void
onPointerDownOutside(event: PointerDownOutsideEvent) => void
onFocusOutside(event: FocusOutsideEvent) => void
onInteractOutside(event: PointerDownOutsideEvent | FocusOutsideEvent) => void
side"top" | "right" | "bottom" | "left"
sideOffsetnumber
align"center" | "start" | "end"
alignOffsetnumber
arrowPaddingnumber
avoidCollisionsboolean
collisionBoundaryElement | Element[]
collisionPaddingnumber | Partial<Record<"top" | "right" | "bottom" | "left", number>>
sticky"always" | "partial"
hideWhenDetachedboolean
updatePositionStrategy"always" | "optimized"
asChildboolean

<MenubarItem>

PropTypeDefaultDescription
destructivebooleanStyle as a destructive action (red text, red hover).
startIconreact.ReactNodeIcon rendered before the label. Sized to 1em.
shortcutreact.ReactNodeTrailing text shown muted, e.g. a keyboard shortcut hint ("⌘K").
onSelect(event: Event) => void
disabledboolean
textValuestring
asChildboolean

<MenubarCheckboxItem>

PropTypeDefaultDescription
onSelect(event: Event) => void
disabledboolean
textValuestring
checkedCheckedState
onCheckedChange(checked: boolean) => void
asChildboolean

<MenubarRadioGroup>

PropTypeDefaultDescription
valuestring
onValueChange(value: string) => void
asChildboolean

<MenubarRadioItem>

PropTypeDefaultDescription
onSelect(event: Event) => void
disabledboolean
textValuestring
valuerequiredstring
asChildboolean

<MenubarLabel>

PropTypeDefaultDescription
asChildboolean

<MenubarSeparator>

PropTypeDefaultDescription
asChildboolean

<MenubarGroup>

PropTypeDefaultDescription
asChildboolean

<MenubarSub>

PropTypeDefaultDescription
childrenReactNode
openboolean
defaultOpenboolean
onOpenChange(open: boolean) => void

<MenubarSubTrigger>

PropTypeDefaultDescription
startIconreact.ReactNode
disabledboolean
textValuestring
asChildboolean

<MenubarSubContent>

PropTypeDefaultDescription
size"sm" | "md"
loopbooleanfalseWhether keyboard navigation should loop around
onEscapeKeyDown(event: KeyboardEvent) => void
onPointerDownOutside(event: PointerDownOutsideEvent) => void
onFocusOutside(event: FocusOutsideEvent) => void
onInteractOutside(event: PointerDownOutsideEvent | FocusOutsideEvent) => void
forceMounttrueUsed to force mounting when more control is needed. Useful when controlling animation with React animation libraries.
alignAlignSubContentControls the direction the subcontent appears from its anchor menu item Default: start
sideOffsetnumber
alignOffsetnumber
arrowPaddingnumber
avoidCollisionsboolean
collisionBoundaryElement | Element[]
collisionPaddingnumber | Partial<Record<"top" | "right" | "bottom" | "left", number>>
sticky"always" | "partial"
hideWhenDetachedboolean
updatePositionStrategy"always" | "optimized"
asChildboolean

Accessibility

The bar renders role="menubar" with menu triggers. The left and right arrow keys move between menus, the up and down keys move within one, and Escape closes the open menu. Typing jumps to a matching item.

Checkbox and radio items expose aria-checked. The arrow keys follow the reading direction in RTL.