Skip to content

Navigation

IMenubar

An application menubar — File, Edit, View. Once one menu is open, hovering another swaps to it without a second click.

Last action: —

When to reach for one

A menubar suits a document-like application with a large set of commands. For a handful of actions on a page, use an IToolbar or a single IDropdownMenu.

Each menu takes the same entry shape as IDropdownMenu: separators, submenus, danger and icons all behave the same way.

A menu's value identifies it, and falls back to the label.

ts
const menus = [
  { label: 'File', value: 'file', items: fileItems },
  { label: 'Edit', items: editItems }, //     value is "Edit"
  { label: 'Tools', disabled: true, items: [] }, // present but not openable
]

Controlling which menu is open

v-model holds the value of the open menu, or undefined when none is.

vue
<IMenubar v-model="openMenu" :menus="menus" />

Bare

Drops the container so the triggers sit directly on the page — for an app shell that already provides its own bar.

Props

PropTypeDefaultDescription
menusMenubarMenuOption[][]
modelValuestringValue of the open menu; v-model
barebooleanfalseDrop the container
loopbooleanfalseWrap from the last menu back to the first
align'start' | 'center' | 'end''start'How each panel aligns to its trigger
sideOffsetnumber6Gap between panel and trigger
unstyledbooleanSkip built-in classes
ui{ root?, trigger?, content?, item?, label?, separator?, subTrigger?, subContent? }Per-slot class overrides
FieldTypeDescription
labelstring
valuestringDefaults to the label
disabledboolean
itemsDropdownMenuEntry[]The menu's entries

Slots

SlotPropsDescription
trigger{ menu }Replaces a trigger's contents

Accessibility

The bar is one Tab stop. Arrow keys move between menus, or opens one, and while a menu is open the left and right arrows move to its neighbours. Escape closes and returns focus to the trigger.