# Command Palette

Search panel that types a query, narrows the list live, glides its highlight to the surviving match and presses it.

```bash
npx shadcn add https://www.reelcn.dev/r/command-palette.json
```

Usage:

```tsx
<Center>
  <CommandPalette
    items={[{ label: "New project" }, { label: "New template" }, { label: "Open settings" }]}
    query="new t"
    select="New template"
    selectAt={70}
  />
</Center>
```

Use for:

- A ⌘K launcher, quick switcher or fuzzy search in a product demo
- Showing how fast a search or command feature narrows results

Avoid:

- A shell session with commands and output. Use `terminal`


## Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| delay? | `number` | — | Frames to wait before entering. |
| duration? | `number` | — | Enter duration in frames. Defaults to 0.6s. Some items reuse `duration` for an unrelated local timing. See that item's own prop docs. |
| exit? | `number \| boolean` | — | Exit at the end of the parent `<Sequence>`. `false` keeps it on screen, a number sets the exit length in frames. |
| motion? | `MotionPersonality` | — | Override the theme's motion personality. |
| poster? | `boolean` | — | Renders fully entered, with no exit: for a still frame or thumbnail. Defaults to `false`. |
| holdFrames? | `number` | — | Delays the start of the exit window by this many frames, for a minimum on-screen hold. Defaults to `0`. |
| items | `CommandItem[]` | — |  |
| query | `string` | — | Typed into the search field, character by character. |
| cps? | `number` | `14` | Query typing speed in characters per second. |
| select? | `string` | — | Label of the item that stays selected as the list narrows. Defaults to the first item. |
| selectAt? | `number` | — | Frame the selected row is "pressed", counted from `delay`. Omit to just leave it highlighted. |
| width? | `number` | `520` | Panel width in design units. |
| background? | `string` | — |  |
| borderColor? | `string` | — |  |
| textColor? | `string` | — |  |
| mutedColor? | `string` | — |  |
| accentColor? | `string` | — |  |
| radius? | `number` | — |  |
| follow? | `CaretFollow` | — | Zooms the camera to trail the caret as it types. Omitted (default): today's behavior, unchanged. |
| style? | `CSSProperties` | — |  |
| className? | `string` | — |  |