# Command (/popups/command)





<ComponentPreview name="command-preskok-demo" description="Command palette with searchable items and groups." />

## Installation [#installation]

<CodeTabs>
  <TabsList>
    <TabsTrigger id="cli">
      CLI
    </TabsTrigger>

    <TabsTrigger id="manual">
      Manual
    </TabsTrigger>
  </TabsList>

  <TabsContent id="cli">
    ```bash
    npx shadcn@latest add @preskok/command
    ```
  </TabsContent>

  <TabsContent id="manual">
    <Steps>
      <Step>
        Copy and paste the following code into your project.

        <ComponentSource name="command" title="registry/preskok/ui/preskok-ui/command.tsx" />
      </Step>

      <Step>
        Update the import paths to match your project setup.
      </Step>
    </Steps>
  </TabsContent>
</CodeTabs>

## Usage [#usage]

```tsx
import {
  Command,
  CommandEmpty,
  CommandGroup,
  CommandInput,
  CommandItem,
  CommandList,
} from "@/components/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 [#components]

### Command [#command]

The root command component that manages state and keyboard navigation.

### CommandInput [#commandinput]

Search input for filtering command items.

### CommandList [#commandlist]

Container for command groups and items.

### CommandEmpty [#commandempty]

Displayed when no results match the search query.

### CommandGroup [#commandgroup]

Groups related command items together with an optional heading.

### CommandItem [#commanditem]

Individual selectable command option.

### CommandSeparator [#commandseparator]

Visual separator between command groups.
