shadcn.io is not affiliated with official shadcn/ui
Menubar examples · Standard
Application Menubar for React
An application menubar with File, Edit and View menus, separators between command groups and a shortcut on each common command.
A desktop-style web app needs more than one menu: File, Edit and View across the top, each with its own commands. This menubar puts three MenubarMenus side by side, with MenubarShortcut hints on the file and clipboard commands and separators between groups. It fits editors, design tools and any app that mirrors a desktop program.
Preview
Installation
FAQ
Which menus are on this bar?
File (New File, Open, Save), Edit (Undo, Redo, Cut, Copy, Paste) and View (Toggle Fullscreen, Zoom In, Zoom Out). Each is a MenubarMenu with a MenubarTrigger and a MenubarContent.
Which rows show a keyboard hint?
Every File and Edit row: New File ⌘N, Open ⌘O, Save ⌘S, Undo ⌘Z, Redo ⇧⌘Z, Cut ⌘X, Copy ⌘C and Paste ⌘V. The View rows have none.
Where do the separators sit?
A MenubarSeparator before Save in File, between Redo and Cut in Edit, and after Toggle Fullscreen in View, splitting each menu into related commands.
Do those shortcut hints fire the command?
No. MenubarShortcut only prints the text. Register the keys on the page so they work while every menu is closed, and run the same command the row runs.
How do I move across File, Edit, and View?
Enter, Space or Arrow Down opens the focused menu, the arrow keys move through its rows, and Escape closes it and returns focus to its trigger. Arrow Left and Arrow Right move between the triggers, and Tab leaves the bar.
Should these menus be one dropdown?
No. Three menus of related commands read better side by side, the way desktop apps lay them out. Use a Dropdown Menu when there's only one list of actions.
Related
- Simple Text MenubarA menubar with one File menu of plain
- Menubar with ShortcutsAn Edit menu with Undo, Redo, Cut and
- Menubar with SubmenuA File menu with an Open Recent submenu
- Menubar with Destructive ActionAn Edit menu with Cut, Copy and Paste
- Dropdown with Shortcuts Dropdown MenuA file and clipboard menu behind a menu
- Compact MenubarA menubar with a single Options menu