# Shadcn Shortcuts

> Command with shortcuts

- Type: example, free and open source (MIT)
- Component: [Command](https://reui.io/components/command.md)
- Page: https://reui.io/components/command/c-command-2
- 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-2")`
- Registry item: https://reui.io/r/styles/base-nova/c-command-2.json
- Uses: Button, Command

## Best for

The smallest modal palette, a single Settings group of 3 rows with a shortcut hint on each

## Agent notes

- The palette opens only from the `Button` that calls `setOpen`; no global key listener exists, so add one for a shortcut such as ⌘K

## When not to use

- A menu shown in place on the page that needs no button to open it: use [Basic](https://reui.io/components/command/c-command-1.md) (`get_example("c-command-1")`)

## 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-2
```

## 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.
