Command
A searchable list of commands. It powers the ⌘K search on this site. Input and rows are 44px.
Installation
npx shadcn@latest add @sevenone/commandUsage
import {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
} from "@/components/ui/command"Examples
Default
No results found.
<Command>
<CommandInput placeholder="Type a command or search…" />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem><File /> New file</CommandItem>
<CommandItem><Search /> Search docs</CommandItem>
</CommandGroup>
</CommandList>
</Command>Accessibility
- Arrow keys move through results and Enter runs one.
- Results are announced as you type.