shadcn.io is not affiliated with official shadcn/ui
Command examples · Standard
Command with Icons and Shortcuts for React
An inline command menu with icons on every item and shortcut hints on the settings.
Suggestions with icons, then Settings with shortcut hints such as ⌘P. The icons help people scan the list, and the hints teach the keys for next time. 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.
Which items show an icon, and which show a shortcut?
Every item has an icon. The Suggestions group holds Calendar, Search Emoji and Calculator. The Settings group holds Profile, Billing and Settings, each with a shortcut label: ⌘P, ⌘B and ⌘S.
Do those shortcut hints fire the keys?
No. CommandShortcut is a label at the end of the row, and the item's check mark stays hidden while it's there. Listen for those keys yourself if Profile, Billing or Settings should run from the keyboard.
What appears when nothing matches the search?
CommandEmpty in the list says "No results found." It shows only when the search leaves nothing.
Related
- Command Dialog with Icons and ShortcutsA button that opens a command dialog with
- Command Popover with Icons and ShortcutsA button that opens a command popover
- Command Actions MenuAn inline command menu of quick and file
- With Item Icons ComboboxA combobox with an icon beside each
- Command with BadgesAn inline command menu of components
- Command with DescriptionsAn inline command menu of contact