Skip to content

CommandMenu ​

CommandMenu is a Cmd+K command palette overlay with fuzzy search, keyboard navigation, and group support.

Basic usage ​

Press Cmd+K (or Ctrl+K on Windows/Linux) anywhere on this page to open the demo palette, or click the button below.

Tailwind v4
vue
<script setup>
import { ref } from 'vue'

const open = ref(false)

const items = [
  {
    id: 'new-file',
    label: 'New File',
    description: 'Create a new file',
    icon: 'πŸ“„',
    group: 'File',
    shortcut: ['⌘', 'N'],
    action: () => createFile(),
  },
  {
    id: 'settings',
    label: 'Settings',
    group: 'App',
    action: () => openSettings(),
  },
]
</script>

<Button @click="open = true">Open Command Menu</Button>
<CommandMenu v-model="open" :items="items" />

Props ​

PropTypeDefaultDescription
modelValuebooleanfalseControls open state (use with v-model)
placeholderstring'Search commands…'Search input placeholder
itemsCommandItem[][]List of command items

CommandItem interface ​

ts
interface CommandItem {
  id: string
  label: string
  description?: string
  icon?: string
  group?: string
  shortcut?: string[]
  action: () => void
}

Events ​

EventPayloadDescription
update:modelValuebooleanEmitted when open state changes

Keyboard shortcuts ​

KeyAction
Cmd+K / Ctrl+KToggle menu
↑ / ↓Navigate items
EnterExecute selected item
EscapeClose menu

Private β€” Jetpack Labs internal use only