Skip to content
SevenOne

Search documentation

Search pages and components

Command

A searchable list of commands. It powers the ⌘K search on this site. Input and rows are 44px.

Installation

npx shadcn@latest add @sevenone/command

Usage

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

Examples

Default

<Command>
  <CommandInput placeholder="Type a command or search…" />
  <CommandList>
    <CommandEmpty>No results found.</CommandEmpty>
    <CommandGroup heading="Suggestions">
      <CommandItem><File /> New file</CommandItem>
      <CommandItem><Search /> Search docs</CommandItem>
    </CommandGroup>
  </CommandList>
</Command>

Accessibility

  • Arrow keys move through results and Enter runs one.
  • Results are announced as you type.