shadcn.io is not affiliated with official shadcn/ui
Command examples · Standard
Command Actions Menu for React
An inline command menu of quick and file actions, each with an icon and a shortcut hint.
Six file actions in two groups, Quick Actions and File Actions, each with an icon and the shortcut it stands for. Use it where the same few operations come up again and again and people would rather type than hunt through a toolbar. The menu sits in the page, always open, with no trigger. In React, Base UI handles the keyboard navigation.
Preview
Installation
FAQ
How is this menu placed on the page?
Command has h-auto w-full max-w-lg rounded-lg border shadow-md: it sits in the page flow, up to a max width, with a border and a shadow. The list is always open and there is no trigger.
How are the actions grouped?
Two CommandGroups: Quick Actions holds Open, Copy and Add to Favorites, and File Actions holds Download, Share and Delete. There is no separator, so the headings alone split them. Each row starts with a decorative icon: ArrowRight, Copy, Star, Download, Share or Trash.
Where do the key hints come from?
Each hint is a CommandShortcut: Open shows ↵, Copy ⌘C, Add to Favorites ⌘D, Download ⌘⇧D, Share ⌘⇧S and Delete ⌘⌫. It's a label at the end of the row and binds nothing: listen for those keys yourself if they should run the action.
What appears when nothing matches the search?
CommandEmpty in the list says "No actions found." It shows only when the search leaves nothing.
Related
- Command Dialog Actions MenuA Quick Actions button that opens a
- Command Popover Actions MenuA Quick Actions button that opens a
- Command with Icons and ShortcutsAn inline command menu with icons on
- Command with BadgesAn inline command menu of components
- Simple Context MenuA right-click area that opens Back
- Command with DescriptionsAn inline command menu of contact