# Shadcn File Search

> File search command palette

- Type: example, free and open source (MIT)
- Component: [Command](https://reui.io/components/command.md)
- Page: https://reui.io/components/command/c-command-5
- Docs (Base UI): https://ui.shadcn.com/docs/components/base/command.md
- Docs (Radix UI): https://ui.shadcn.com/docs/components/radix/command.md
- MCP: `get_example("c-command-5")`
- Registry item: https://reui.io/r/styles/base-nova/c-command-5.json
- Uses: Badge, Button, Command, Kbd

## Best for

A file finder whose rows show name, muted path and a type Badge, opened from a search style trigger with a Kbd hint

## Agent notes

- Replace `files` with your own list; each row is keyed by `file.path`, so paths must stay unique
- The ⌘K `Kbd` on the trigger is only a label; add a keydown listener that calls `setOpen` to make it work
- Each `CommandItem` filters on its whole text, so a query also matches `file.path` and the `file.type` badge

## When not to use

- A search over people with avatars, emails and role badges: use [User Search](https://reui.io/components/command/c-command-6.md) (`get_example("c-command-6")`)

## Third-party libraries

- cmdk v1: [API reference](https://github.com/dip/cmdk#parts-and-styling), [docs](https://github.com/dip/cmdk), through shadcn Command

## Install

```bash
npx shadcn@latest add @reui/c-command-5
```

## About Shadcn Command

### When to use

- Keyboard driven palettes in a modal that search actions, pages and settings from one input
- Search lists of files, team members, favorites and recent pages that narrow as the user types
- Inline menus kept open in a card or panel, with grouped rows and keyboard shortcut hints

### When not to use

- A form field that keeps the option the user picks, such as a country or an assignee: use [Combobox](https://reui.io/components/combobox.md) (`get_component("combobox")`)
- A complete product layout with sidebar navigation, where search is only one of its parts: use the [App Shell blocks](https://reui.io/blocks/application/app-shell.md)
- A top bar above your page with brand, menus and alerts, where search sits beside them: use the [Navbar blocks](https://reui.io/blocks/application/navbar.md)

### Agent notes

- No example gives a `CommandItem` a select handler, so pressing Enter or clicking a row runs nothing until you add one
- `CommandList` stops at 18rem tall in every style and scrolls the rows past that height inside itself

Every ReUI item has a twin like this one; the index is https://reui.io/llms.txt. Agents with the ReUI MCP (https://reui.io/docs/mcp) get the same guidance from the getters named above.
