Skip to content
Star

PxCommandPalette

A command palette / Spotlight-style universal search dialog accessible with Ctrl + K (or Cmd + K on macOS). Provides instant search, grouped actions, keyboard navigation, and keyboard shortcut indicators.

Basic Usage

Click the button below or press Ctrl + K anywhere on this page to test it.

Command Palette

API Reference

PropTypeDefaultDescription
modelValue
booleanfalse
commands
CommandItem[]() => []
placeholder
string"Escribe un comando o busca..."
emptyText
string"No se encontraron resultados"
disableShortcut
booleanfalse
shortcutKey
string"k"
maxHeight
string"max-h-80"
closeOnSelect
booleantrue

CommandItem Interface

ts
interface CommandItem {
  id: string | number
  title: string
  subtitle?: string
  group?: string          // Categorizes commands into sections
  icon?: Component        // Icon component (e.g. Lucide)
  badge?: string          // Small tag displayed next to title
  shortcut?: string[]     // Visual shortcut hints (e.g. ['Ctrl', 'P'])
  keywords?: string[]     // Additional search terms
  disabled?: boolean
  perform?: (item: CommandItem) => void
}

Built with VitePress