shadcn.io is not affiliated with official shadcn/ui
Dropdown Menu examples · Standard
Dropdown with Shortcuts Dropdown Menu for React
A file and clipboard menu behind a menu button, with a keyboard shortcut on every row.
Nobody memorizes dozens of key combos up front; they learn them from menus. This dropdown menu shows the shortcut next to each action: ⌘N for New File, ⌘C, ⌘X and ⌘V for the clipboard, ⌘F for Search and ⌘⌫ for a destructive Delete. It fits editors, file managers and productivity apps.
Preview
Installation
FAQ
Which hints does this menu show?
New File ⌘N, Copy ⌘C, Cut ⌘X, Paste ⌘V, Search ⌘F and Delete ⌘⌫, each in a DropdownMenuShortcut at the end of the row. They only print the hint; bind the keys on the page so they work while the menu is closed.
How are the rows grouped?
Separators split them into New File; Copy, Cut and Paste; then Search and Delete. The menu is w-56.
What sits in front of each label?
A file, copy, scissors, clipboard, search or trash icon, aria-hidden, so the label carries the meaning.
What does the trigger look like?
An outline Button with size="icon-md", a menu icon and aria-label set to Open menu.
Related
- Simple Dropdown with Icons Dropdown MenuA short menu behind a dots button with an
- Mixed Features Dropdown Dropdown MenuA File menu that mixes actions with
- Text Formatting Dropdown Dropdown MenuA text formatting menu with bold, italic
- Simple Command DialogA button that opens a command dialog with
- Simple Context MenuA right-click area that opens Back
- Dropdown with Checkboxes Dropdown MenuA View menu of checkbox rows that show or