Command

Searchable list of actions, inline or in a dialog.

Suggestions
Inbox
Calendar
New file⌘N
Settings
Profile⌘P
Preferences⌘,

Installation

pnpm dlx shadcn@latest add @paneui/command

Usage

Composition

Examples

Dialog

Use for an app-wide palette opened with a shortcut.

Keyboard

↑/↓ (or Ctrl+N / Ctrl+P) move the highlight, Enter runs it, typing filters. Groups with no matches hide, and separators hide while searching.

Filtering

Items rank by prefix, then substring, then letters in order, across value and keywords. Pass filter to change the ranking, or shouldFilter={false} when you filter the items yourself.

API Reference

Command

Also accepts every prop of div.

search
string
Controlled search text.
onSearchChange
(search: string) => void
Called as the input changes.
filter= prefix / substring / in-order letters
(value, search, keywords?) => number
Ranking; 0 hides the item.
shouldFilter= true
boolean
Set false for server-filtered items.
loop= false
boolean
Wrap at the ends with the arrow keys.
PropTypeDefaultDescription
searchstring—Controlled search text.
onSearchChange(search: string) => void—Called as the input changes.
filter(value, search, keywords?) => numberprefix / substring / in-order lettersRanking; 0 hides the item.
shouldFilterbooleantrueSet false for server-filtered items.
loopbooleanfalseWrap at the ends with the arrow keys.

CommandDialog

The Command in a centred dialog; the input takes focus on open. Also accepts every prop of Dialog.Root.

title= "Command palette"
string
Screen-reader title.
commandProps
CommandProps
Props for the inner Command.
PropTypeDefaultDescription
titlestring"Command palette"Screen-reader title.
commandPropsCommandProps—Props for the inner Command.

CommandItem

Also accepts every prop of div.

value= the text content
string
Identity and search text.
keywords
string[]
Extra words that match.
onSelect
(value: string) => void
Runs on click or Enter.
disabled= false
boolean
Skip in navigation and dim.
PropTypeDefaultDescription
valuestringthe text contentIdentity and search text.
keywordsstring[]—Extra words that match.
onSelect(value: string) => void—Runs on click or Enter.
disabledbooleanfalseSkip in navigation and dim.
data-selected
Present on the highlighted item.
Data attributeDescription
data-selectedPresent on the highlighted item.

CommandInput

Also accepts every prop of input.

CommandList

Scrolls at 20rem. Also accepts every prop of div.

CommandEmpty

Rendered only when nothing matches. Also accepts every prop of div.

CommandGroup

Also accepts every prop of div.

heading
ReactNode
Label above the items.
PropTypeDefaultDescription
headingReactNode—Label above the items.

CommandSeparator

Also accepts every prop of div.

CommandShortcut

Also accepts every prop of span.