components

Command

Fast, composable, unstyled command menu for React.

Source Codecmdk

Installation

pnpm dlx radianui@latest add command

Usage

Imports

/components/ui/command.tsx
import {
	Command,
	CommandDivider,
	CommandEmpty,
	CommandGroup,
	CommandInput,
	CommandItem,
	CommandList,
	CommandShortcut,
} from "@/components/ui/command"

Code

/components/ui/command.tsx
<Command>
	<CommandInput placeholder="Type a command or search..." />
	<CommandList>
		<CommandEmpty>No results found.</CommandEmpty>
		<CommandGroup heading="Suggestions">
			<CommandItem>Calendar</CommandItem>
			<CommandItem>Search Emoji</CommandItem>
			<CommandItem>Calculator</CommandItem>
		</CommandGroup>
		<CommandDivider />
		<CommandGroup heading="Settings">
			<CommandItem>Profile</CommandItem>
			<CommandItem>Billing</CommandItem>
			<CommandItem>Settings</CommandItem>
		</CommandGroup>
	</CommandList>
</Command>