Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Command Menu

ProNew

A command palette with fuzzy search, highlighted matches, a gliding selection and a panel that resizes as you type.

Installation

pnpm dlx shadcn@latest add @viewport/command-menu

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
commands*Command[]—
openboolean

Controlled open state.

—
onOpenChange(open: boolean) => void—
hotkeystring | false

Letter that toggles the menu with Cmd or Ctrl. Pass false to disable.

"k"
titlestring

Accessible name for the dialog.

"Command menu"
placeholderstring"Type a command or search…"
childrenReact.ReactNode

The element that opens the menu, usually a button.

—

Accessibility

  • Radix Dialog with the combobox pattern: focus stays in the input.
  • Arrow keys, Home and End move; Enter runs; Escape closes and restores focus.
  • Cmd or Ctrl plus K toggles it; an empty result is announced.