No results found.
Suggestions
Calendar
Search Emoji
Settings
Profile
Documents
Settings
"use client"
import {
CalendarIcon,
FileIcon,
SettingsIcon,
SmileIcon,
UserIcon,
} from "lucide-react"
import {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
} from "@/components/ui/preskok-ui/command"
export function CommandPreskokDemo() {
return (
<Command className="rounded-lg border shadow-md">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem>
<CalendarIcon className="mr-2 size-4" />
<span>Calendar</span>
</CommandItem>
<CommandItem>
<SmileIcon className="mr-2 size-4" />
<span>Search Emoji</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem>
<UserIcon className="mr-2 size-4" />
<span>Profile</span>
</CommandItem>
<CommandItem>
<FileIcon className="mr-2 size-4" />
<span>Documents</span>
</CommandItem>
<CommandItem>
<SettingsIcon className="mr-2 size-4" />
<span>Settings</span>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
)
}
Installation
CLI
pnpmnpmyarnbunpnpm dlx @preskok-org/ui@latest add command
Usage
import {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
} from "@/registry/preskok/ui/preskok-ui/command"
export function CommandDemo() {
return (
<Command>
<CommandInput placeholder="Type a command..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem>Calendar</CommandItem>
<CommandItem>Search Emoji</CommandItem>
</CommandGroup>
</CommandList>
</Command>
)
}Components
Command
The root command component that manages state and keyboard navigation.
CommandInput
Search input for filtering command items.
CommandList
Container for command groups and items.
CommandEmpty
Displayed when no results match the search query.
CommandGroup
Groups related command items together with an optional heading.
CommandItem
Individual selectable command option.
CommandSeparator
Visual separator between command groups.