Search documentation

Search components and pages

Command

Command menu for search and quick actions.

01

Installation

Add the command component with the shadcn CLI.

bash
npx shadcn@latest add https://swiss.ui.unsanity.ai/r/command.json
02

Usage

tsx
import { Command } from "@/components/ui/command"
03

Examples

Default

import { CalendarIcon, SearchIcon, SettingsIcon, UserIcon } from "lucide-react"

import {
  Command,
  CommandEmpty,
  CommandGroup,
  CommandInput,
  CommandItem,
  CommandList,
  CommandSeparator,
} from "@/components/ui/command"

<Command className="w-72 border border-border">
  <CommandInput placeholder="Type a command..." />
  <CommandList>
    <CommandEmpty>No results found.</CommandEmpty>
    <CommandGroup heading="Suggestions">
      <CommandItem><CalendarIcon />Calendar</CommandItem>
    </CommandGroup>
  </CommandList>
</Command>