Redpanda UIRedpanda UI

Menubar

A visually persistent menu common in desktop applications that provides quick access to a consistent set of commands.

Made by shadcn

Installation

Loading component...

When to use

The Menubar component provides persistent menu access similar to desktop applications. Use this decision tree to determine when it's appropriate:

Usage

import {
  Menubar,
  MenubarContent,
  MenubarItem,
  MenubarMenu,
  MenubarSeparator,
  MenubarShortcut,
  MenubarTrigger,
} from "@/components/ui/menubar"
<Menubar>
  <MenubarMenu>
    <MenubarTrigger>File</MenubarTrigger>
    <MenubarContent>
      <MenubarItem>
        New Tab <MenubarShortcut>⌘T</MenubarShortcut>
      </MenubarItem>
      <MenubarItem>New Window</MenubarItem>
      <MenubarSeparator />
      <MenubarItem>Share</MenubarItem>
      <MenubarSeparator />
      <MenubarItem>Print</MenubarItem>
    </MenubarContent>
  </MenubarMenu>
</Menubar>

Examples

Checkbox items

Loading component...

Radio items

Loading component...

Nested submenus

Loading component...

Props

Keyboard interactions

KeyAction
Tab into the menubarFocus lands on the first top-level trigger.
ArrowLeft / ArrowRightMoves between top-level menus.
ArrowDown / Enter / SpaceOpens the focused menu and focuses its first item.
ArrowUp / ArrowDown (inside a menu)Moves between items.
ArrowLeft / ArrowRight (inside a menu)Opens / closes submenus and moves between adjacent menus.
Home / EndJumps to first / last item.
Enter / SpaceActivates the focused item.
EscapeCloses the open menu.
Typing a characterTypeahead jumps to the next matching item.

Accessibility

  • The menubar container has role="menubar" and each top-level trigger role="menuitem" with aria-haspopup="menu" and aria-expanded.
  • Focus is roving across both the menubar and each menu; only one trigger is in the tab order.
  • Keep labels short and single-level where possible. Deeply nested submenus are hard to reach for motor-impaired users — consider a DropdownMenu with keepMounted panels instead.
  • Base UI note: the Radix value / onValueChange props on Menubar do not exist — open state lives on each child MenubarMenu. See the migration callout.

Credits

  • We use Base UI for the menubar component.
  • We take our inspiration from Shadcn UI for the menubar style.

Recent changes

  • patchv1.2.0Pin shipped dependency floors to the version we develop against. Registry items now declare ranges like `^5.1.9` (the actual installed version) instead of collapsing to `^5.0.0`, so consumers start on the known-tested b…#133
  • minorv1.1.0Theme docs refresh, readability pass on semantic foregrounds, and consumer-facing Base UI regression fixes.#121
  • minorv1.1.0Bulk install experience and Dialog polish.#119
  • minorv1.0.0Post-Base-UI polish. Public API unchanged.#116
  • majorv1.0.0Migrate every Radix-based primitive to `@base-ui/react@^1.4.0` (Base UI).#114
See full history →
Built by malinskibeniamin. The source code is available on GitHub.

On this page