Command
A fast, composable command menu built on cmdk.
Installation
pnpm dlx shadcn@latest add https://8bit.cnlibs.com/r/command.jsonUsage
import {
CalculatorIcon,
CalendarIcon,
SettingsIcon,
SmileIcon,
} from "lucide-react";
import {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from "@/components/ui/command";<Command className="w-full max-w-md">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem>
<CalendarIcon />
Calendar
</CommandItem>
<CommandItem>
<SmileIcon />
Search Emoji
</CommandItem>
<CommandItem>
<CalculatorIcon />
Calculator
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem>
<SettingsIcon />
Preferences
<CommandShortcut>⌘,</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>