shadcn.io is not affiliated with official shadcn/ui
Command examples · Standard
Command with Badges for React
An inline command menu of components, each with a Stable or Beta badge at the end of its row.
Four components, each tagged Stable or Beta with a Badge at the end of its row. Use a badge when people should know an item's state before they pick it, and keep its text to a word. 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 does Stable or Beta sit at the end of the row?
The name's span has flex-1, so it fills the row and pushes the Badge to the end. Button and Input read Stable with variant="secondary", and Table and DataGrid read Beta with variant="outline". The status and the variant sit in the data beside each name.
Which icon goes with each component?
FileText is Button, Code is Input, Database is Table, and Package is DataGrid. The icon is the first child of CommandItem and is hidden from screen readers, since the name says the same thing.
What appears when nothing matches the search?
CommandEmpty in the list says "No components found." It shows only when the search leaves nothing.
Related
- Command Dialog with BadgesA Browse Components button that opens a
- Command Popover with BadgesA Browse Components button that opens a
- Command with Status IndicatorsAn inline command menu of services, each
- Command Actions MenuAn inline command menu of quick and file
- Badge with Text (Standard)A default badge with a short label for a
- Command with DescriptionsAn inline command menu of contact