Unified UI

Menubar

A horizontal application menu bar with keyboard navigation, submenus, checkbox and radio items. Built on Radix UI.

Overview

Menubar is a horizontal application menu bar — the kind you see in desktop apps (File, Edit, View, etc.). Built on Radix UI's Menubar primitive, it provides full keyboard navigation, nested submenus, checkbox/radio items, and shortcut hints.


Installation

Install the component via the CLI in one command.

npx @work-rjkashyap/unified-ui add menubar
pnpm dlx @work-rjkashyap/unified-ui add menubar
npx @work-rjkashyap/unified-ui add menubar
bunx @work-rjkashyap/unified-ui add menubar

If you haven't initialized your project yet, run npx @work-rjkashyap/unified-ui init first. See the CLI docs for details.

Or install the full package

Use this approach if you prefer to install the entire design system as a dependency instead of copying individual components.

npm install @work-rjkashyap/unified-ui
pnpm add @work-rjkashyap/unified-ui
yarn add @work-rjkashyap/unified-ui
bun add @work-rjkashyap/unified-ui

Anatomy

import {
	Menubar,
	MenubarMenu,
	MenubarTrigger,
	MenubarContent,
	MenubarItem,
	MenubarSeparator,
	MenubarLabel,
	MenubarShortcut,
	MenubarSub,
	MenubarSubTrigger,
	MenubarSubContent,
	MenubarCheckboxItem,
	MenubarRadioGroup,
	MenubarRadioItem,
	MenubarGroup,
} from "@work-rjkashyap/unified-ui";

Examples

Basic

With Submenus

Checkbox and Radio Items


Props

PropTypeDefaultDescription
dir"ltr" | "rtl"Reading direction.
loopbooleantrueWhether keyboard focus loops between menus.
classNamestringAdditional CSS classes on the root bar element.
PropTypeDefaultDescription
valuestringUnique value (needed for controlled open state).
PropTypeDefaultDescription
classNamestringAdditional CSS classes.
disabledbooleanfalseDisables the trigger.
PropTypeDefaultDescription
variant"default" | "danger""default"Visual style for destructive actions.
iconReactNodeIcon rendered before the label.
insetbooleanfalseAdds left padding to align without an icon.
disabledbooleanfalseDisables the item.
onSelect(e: Event) => voidCallback fired when the item is selected.

Accessibility

Menubar navigation follows the ARIA Authoring Practices Guide for menu bars. Use the Menubar when you need desktop-app style navigation; for simpler site navigation, prefer NavigationMenu.

  • F6 / Tab — Moves focus to the menubar.
  • Left / Right arrows — Move between top-level menu triggers.
  • Enter / Space / Down arrow — Opens the focused menu.
  • Up / Down arrows — Navigate within an open menu.
  • Escape — Closes the open menu and returns focus to the trigger.
  • role="menubar", role="menu", and role="menuitem" are applied by Radix UI.

On this page