shadcn.io is not affiliated with official shadcn/ui
Command examples · Standard
Command with Separators for React
An inline command menu with recent files, folders and media split by separators.
Recent files, folders and media in three groups, with a line between each. Add separators when the headings alone don't break a long list up enough. 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.
Where does the line between groups sit?
A CommandSeparator goes before every group but the first, so the lines fall after Recent and after Folders. Each group keeps its own heading: Recent, Folders and Media.
What does each file row contain?
Every CommandItem starts with a decorative icon, then a span for the name: Document.pdf, Photo.jpg, Projects, Documents, Video.mp4 and Song.mp3. The icons are File, Image, Folder (twice), Video and Music.
What appears when nothing matches the search?
CommandEmpty in the list says "No files found." It shows only when the search leaves nothing.
Related
- Command Dialog with SeparatorsA Search Files button that opens a
- Command Popover with SeparatorsA Search Files button that opens a
- Command with Icons and ShortcutsAn inline command menu with icons on
- Command Actions MenuAn inline command menu of quick and file
- Multiple Groups with Labels ComboboxA combobox with Frontend and Backend
- Command with BadgesAn inline command menu of components