command-demo
Installation
pnpm dlx shadcn@latest add https://ui.n2020.com/r/command.jsonUsage
import {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
} from "@/components/ui/command";<Command>
<CommandInput placeholder="Type a command or search" />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem>Open calendar</CommandItem>
<CommandItem>Invite a teammate</CommandItem>
</CommandGroup>
</CommandList>
</Command>Examples
Dialog
CommandDialog shows the command list in a dialog. Control it with open and onOpenChange.
command-palette