Join our Discord Community

Menubar

A horizontal menu bar component for React and Next.js applications. Perfect for desktop-style interfaces with File, Edit, View menus and keyboard shortcuts.

Remember those classic desktop apps with File, Edit, View menus across the top? That's what menubars do - give your web app that familiar desktop feel with persistent navigation and keyboard shortcuts.

Classic desktop menubar

Complete menubar with submenus, shortcuts, and toggles:

Loading component...

Built on Radix UI Menubar with full keyboard navigation, screen reader support, and all the interaction patterns users expect from desktop apps.

npx shadcn@latest add menubar

Why menubars work for certain apps

Not every app needs a menubar, but when you're building something that feels like desktop software, they're perfect:

  • Familiar patterns - Users know where to find File, Edit, View menus
  • Keyboard shortcuts - Show and handle common shortcuts like ⌘S, ⌘C
  • Persistent access - Always visible, never hidden behind hamburger menus
  • Professional feel - Makes web apps feel more like "real" software
  • Organized actions - Logical grouping of related functionality
  • Space efficient - Pack lots of functionality without clutter

Essential menubar patterns

Simple menu structure

Basic File, Edit, View setup:

Loading component...

With keyboard shortcuts

Show shortcuts to teach users faster workflows:

Loading component...

Checkbox toggles

Perfect for view options and settings:

Loading component...

Nested submenus

Organize complex actions hierarchically:

Loading component...

Radio button groups

Single-choice options like themes or layouts:

Loading component...

Great for desktop-style web apps

Works best when you're building something that feels like traditional desktop software - text editors, IDEs, design tools, productivity apps. The menubar gives users that familiar navigation they're used to.

Drop it into any React or Next.js app where you want that professional, desktop-app aesthetic.

API Reference

The root container that holds all menu groups.

PropTypeDefaultDescription
classNamestring-Additional CSS classes
childrenReact.ReactNode-MenubarMenu components

Individual menu group (like "File" or "Edit").

PropTypeDefaultDescription
childrenReact.ReactNode-MenubarTrigger and MenubarContent

The clickable menu label that opens the dropdown.

PropTypeDefaultDescription
classNamestring-Additional CSS classes
childrenReact.ReactNode-Menu label text

The dropdown content that appears when menu is opened.

PropTypeDefaultDescription
classNamestring-Additional CSS classes
align"start" | "center" | "end""start"Alignment relative to trigger
side"top" | "right" | "bottom" | "left""bottom"Preferred side to open
sideOffsetnumber8Distance from trigger
childrenReact.ReactNode-Menu items and separators

Individual clickable menu item.

PropTypeDefaultDescription
classNamestring-Additional CSS classes
disabledbooleanfalseWhether item is disabled
insetbooleanfalseAdd left padding for alignment
onSelect(event: Event) => void-Callback when item is selected
childrenReact.ReactNode-Item content and shortcuts

Menu item with checkbox for toggleable options.

PropTypeDefaultDescription
checkedboolean | "indeterminate"-Checkbox state
onCheckedChange(checked: boolean) => void-Callback when checkbox changes
classNamestring-Additional CSS classes
childrenReact.ReactNode-Item content

Menu item for single-choice selections within a radio group.

PropTypeDefaultDescription
valuestring-Unique value for this radio option
classNamestring-Additional CSS classes
childrenReact.ReactNode-Item content

Display keyboard shortcuts in menu items.

PropTypeDefaultDescription
classNamestring-Additional CSS classes
childrenReact.ReactNode-Shortcut text (e.g., "⌘S")

Visual separator between menu sections.

PropTypeDefaultDescription
classNamestring-Additional CSS classes

Keyboard Navigation

KeyAction
TabMove focus to next menubar item
Shift + TabMove focus to previous menubar item
Enter / SpaceOpen focused menu
Arrow DownOpen menu or move to next item
Arrow UpMove to previous menu item
Arrow LeftMove to previous menubar menu
Arrow RightMove to next menubar menu
EscapeClose menu and return to menubar
A-ZFocus item starting with typed letter

Common Menu Types

MenuTypical ItemsUse Cases
FileNew, Open, Save, Print, ExportDocument operations
EditUndo, Redo, Cut, Copy, Paste, FindContent editing
ViewZoom, Layout, Sidebar, FullscreenDisplay options
ToolsSettings, Preferences, ExtensionsUtilities
HelpDocumentation, About, SupportUser assistance

Build menubars that make sense

  • Follow conventions - Put File first, Help last, Edit and View in between
  • Group logically - Related actions go together, separated by dividers
  • Show shortcuts - Teach users faster ways to work
  • Keep it simple - Don't nest menus more than 2-3 levels deep
  • Make items scannable - Clear labels, consistent terminology
  • Handle states - Show what's selected, enabled, disabled
  • Test keyboard nav - Make sure everything works without a mouse