Menubar

new

File, Edit, View. The bar your desktop apps have had since 1984, now in Vue.

Menubar

Open Props in the corner of the example to try variant and size. outline frames the bar, soft fills it with the muted surface, and ghost drops both, for a header that already has a frame of its own. size sets the triggers and every menu in one go; items match the height of an Input of the same size, and a MenubarContent or MenubarSubContent with its own size wins.

Installation

Usage

<script setup lang="ts">
import {
  Menubar,
  MenubarContent,
  MenubarItem,
  MenubarMenu,
  MenubarShortcut,
  MenubarTrigger,
} from '@/components/ui/menubar'
</script>

<template>
  <Menubar aria-label="Application">
    <MenubarMenu>
      <MenubarTrigger>File</MenubarTrigger>
      <MenubarContent>
        <MenubarItem @select="create">
          New
          <MenubarShortcut>⌘N</MenubarShortcut>
        </MenubarItem>
        <MenubarItem @select="open">Open…</MenubarItem>
      </MenubarContent>
    </MenubarMenu>
  </Menubar>
</template>

A menubar is a row of menus. Click a trigger to open its menu; once one is open, hovering another trigger switches to it, the way desktop menus work. Menus never open on hover alone.

The menus are the same as Menu's: same items, sizes, state layers and shortcuts.

  • MenubarMenu: one menu, a MenubarTrigger plus a MenubarContent
  • MenubarItem: an action; fires select and closes the whole bar
  • MenubarCheckboxItem, MenubarRadioGroup + MenubarRadioItem: settings
  • MenubarSub, MenubarSubTrigger, MenubarSubContent: submenus
  • MenubarLabel, MenubarGroup, MenubarSeparator: structure
  • MenubarShortcut: a key hint at the end, display only

Use the Menubar* parts only. A MenuSubTrigger inside a menubar opens its submenu and jumps to the next menu on the same keypress.

Give the bar an aria-label. It's a desktop pattern: on small screens, a Menu or a DrawerMenu is kinder to thumbs.

Examples

Icons and states

Icons pick up the item size. inset lines plain items and labels up with checkbox and radio items. A disabled trigger is skipped by the arrow keys and never opens.

Icons and states

Checkbox and radio items

Bind MenubarCheckboxItem and MenubarRadioGroup with v-model. A closed menu is unmounted, so keep the state in your component, not in the items.

Settings
{
  "wordWrap": true,
  "minimap": false,
  "lineNumbers": true,
  "theme": "system"
}

Open state

v-model on Menubar holds the value of the open menu, or "" when none is. Set it to open a menu from code. The open trigger has data-state="open", so style it with data-[state=open]:.

value doubles as the trigger's id, so pick something unique on the page, like menubar-file, or leave it out and let one be generated.

Controlled menubar
Open: none

Dialogs and focus

An item can open a Dialog or an AlertDialog from @select. Bind the dialog's open yourself: the item is gone once the menu closes, so a trigger inside it would go with it. When the dialog closes, send focus back to the bar.

If an item moves focus elsewhere, like Find… here, focus stays there. To keep focus off the trigger in any other case, call preventDefault() in @close-auto-focus on MenubarContent. Reka UI ignores that on its own; the kappa component makes it work.

With dialogs

Editing Roadmap 2026.md

Icon triggers

Give an icon-only trigger a name with aria-label, or with v-tooltip.label, which shows it on hover too. Use the directive, not a Tooltip around the trigger: the component takes over the menu's anchor and the menu opens in the wrong place.

Icon menubar

Right to left

With dir="rtl" on the bar, or from a ConfigProvider, the arrows run the other way, menus align to the trigger's right edge and submenu chevrons flip. Shortcuts stay left to right.

Right-to-left menubar

With a toolbar

A menubar holds menus and nothing else. For buttons and toggles at bar level, like Bold or Italic, use a Toolbar, and put a Menu in one of its buttons when you need a dropdown there.

App shell

The quick brown fox jumps over the lazy dog.

Known limits

  • No actions or toggles at bar level: every trigger opens a menu (reka-ui#2048). Use a Toolbar.
  • Horizontal only. Reka fixes the bar's orientation.
  • A closed menu is unmounted, along with anything inside it (reka-ui#2057). Keep item state in your component, and use links, not a menubar, for navigation that search engines should see.
  • A Tooltip component around a trigger breaks the menu's position (reka-ui#2993). Use v-tooltip.
  • Cancelling a trigger's pointerdown or keydown to stop the menu from opening needs reka-ui 2.11 or later (reka-ui#2984).
  • In a v-for menu, give items stable keys and don't build new prop objects on every render. Re-rendering items under the pointer can swallow a click in Chrome (reka-ui#2783).
  • The item highlight and focus ring follow the theme's state layer and ring tokens, which may fall below 3:1 against the menu on the default theme (nuxt/ui#6588).

API Reference

Every part takes a class that merges with its own. On MenubarContent and MenubarSubContent, it styles the panel.

Data attributes

data-slotAttributesDescription
menubardata-size, data-variantThe bar, a role="menubar". Both are set even at their defaults, md and outline.
menubar-triggerdata-state, data-highlighted, data-disabled, aria-expandedA menu's button, a role="menuitem". data-state is open while its menu is.
menubar-contentdata-state, data-side, data-align, data-sizeA menu's panel, a role="menu" named by its trigger.
menubar-itemdata-highlighted, data-disabled, data-inset, data-colorAn item. data-color carries its color.
menubar-checkbox-itemdata-state, data-highlighted, data-disabledA checkbox item. data-state is checked, unchecked or indeterminate.
menubar-radio-group—A role="group" of radio items.
menubar-radio-itemdata-state, data-highlighted, data-disabledA radio item.
menubar-item-indicatordata-stateThe check or dot of a checked item.
menubar-labeldata-insetA label for the items after it.
menubar-separator—A line between groups.
menubar-group—Related items.
menubar-shortcut—A key combination at the end of an item.
menubar-sub-triggerdata-state, data-highlighted, data-disabled, data-insetThe item that opens a submenu.
menubar-sub-contentdata-state, data-side, data-sizeA submenu's panel.

Accessibility

The bar is one tab stop. Inside it, the arrow keys move between triggers and wrap around by default. Each trigger is a role="menuitem" with aria-haspopup="menu" and aria-expanded, and points at its menu with aria-controls while it's open. The menu is named by its trigger.

Menus are never modal: the page stays live, nothing is hidden from screen readers, and Tab leaves an open menu. Reka's menus would send Tab from the end of the page, since they're portaled there; the kappa parts send it on from the bar, so it reaches the control right after it, or before it with Shift + Tab.

KeyAction
Tab / Shift + TabMoves into the bar, onto the last used trigger, and out again. From an open menu, closes it and moves on from the bar.
ArrowRight / ArrowLeftOn a trigger, moves to the next or previous one. In a menu, opens the next or previous menu, or opens a submenu from its trigger. In a submenu, ArrowLeft closes it and goes back to its trigger. Reversed in right to left.
Home / EndMoves to the first or last trigger, or the first or last item.
Enter / SpaceOpens the trigger's menu and focuses its first item. On an item, chooses it.
ArrowDownOpens the trigger's menu and focuses its first item. In a menu, moves to the next item.
ArrowUpMoves to the previous item. Does nothing on a closed trigger.
EscapeCloses the menu, or just the submenu, and focuses its trigger.
A–ZMoves to the next item starting with that letter.

Changelog

  1. registry 0.22.0

    3ca3f0a — A Menubar trigger clicked while another menu (or its own) is still fading out opens its menu: the closing menu no longer treats that press as an outside click and closes the whole bar.

    a921978 — Menubar switches between menus at once: the menu being left closes without its fade, so ArrowLeft back into a menu that was still closing keeps focus in it instead of dropping it to <body>. Closing by Escape, a pick or an outside click still fades.

    7f34747 — Menubar triggers take the line height of their size's label scale; they read a variable nothing defined and fell back to 1.5 times the font size.

  2. registry 0.21.0

    02e469f — MenuItem, MenubarItem and DrawerMenuItem take color instead of variant: variant="destructive" becomes color="destructive", and every other tone (primary, neutral, success, warning, info or one you declare on [data-slot][data-color="<name>"]) now works too. The item, its icon and its hover layer read --tone-text; data-variant is gone from the item and data-color carries the colour.

  3. registry 0.19.0

    adf96cd — Parts no longer style themselves from their root's size through group-data-[size=…] variants, which beat any plain class of yours. size is the density of the root, and a class on a part wins:

    - Card, Empty, Alert and Stepper: CardTitle, CardDescription, EmptyTitle, EmptyDescription, AlertTitle, AlertDescription, StepperTitle and StepperDescription keep one text size at every root size (title-md/body-md, title-sm/body-md for Alert, title-sm/body-sm for Stepper). Empty's icon and gaps and Stepper's indicator number still follow the size, through --empty-icon, --empty-header-gap, --empty-content-gap and --stepper-text on the root. - Menu and DrawerMenu labels, Menubar triggers and the Calendar heading, weekday cells and week numbers keep scaling with the size, through --menu-label, --menubar-text, --calendar-heading and --calendar-label (each with a -leading twin) set by the root. - AlertDialog size="sm" centres its text through the content, so text-start on AlertDialogHeader wins; the footer keeps its two-column grid.

  4. registry 0.15.0

    d09f26a — Pressable parts ripple on their own: Button, Toggle, ToggleGroupItem, Item as a link or a button, the calendar days, tabs, accordion, menubar and navigation menu triggers, the items of Menu, Menubar, Select, Combobox, Command, DrawerMenu, Listbox and Tree, and the clear buttons of TagsInput and Combobox. Each imports the directive from @/lib/ripple, so add brings the ripple item along and nothing needs registering. On menu, listbox and tree rows the wave replaces the pressed layer, as state-layer already did. Bind v-ripple="false" on a Button to turn one off, or set --kappa-ripple: none on :root to turn them all off.

  5. registry 0.13.0

    839ae3d — New Menubar: a desktop-style row of menus over Reka UI's Menubar, with the shadcn-vue parts (MenubarMenu, MenubarTrigger, MenubarContent, MenubarItem, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarItemIndicator, MenubarLabel, MenubarSeparator, MenubarShortcut, MenubarGroup, MenubarSub, MenubarSubTrigger, MenubarSubContent) and Menu's items, five sizes and state layers. size sets the triggers and every menu from xs to xl; variant is outline, soft or ghost. The arrow keys wrap by default, v-model is typed as the open menu's value, long menus scroll inside the viewport, and a few Reka gaps are closed: moving to an earlier menu with the arrows or the pointer no longer closes the whole bar, Tab from an open menu continues from the bar instead of the end of the page, a menu open on first render is linked to its trigger by aria-controls, and preventDefault() in @close-auto-focus keeps focus off the trigger.