Skip to content

KCommandMenu ​

示例 ​

Press Ctrl+K to open command menu

A command palette overlay with grouped, searchable items and keyboard navigation. Opens with Cmd/Ctrl+K.

Props ​

NameTypeDefaultDescription
openbooleanfalseWhether the command menu is visible.
groupsKCommandMenuGroup[][]Array of groups, each with a name and items array ({ id, label, action? }).
placeholderstring'Type a command or search...'Placeholder text for the search input.
theme'auto' | 'day' | 'night''auto'Theme mode. auto follows the current theme; day and night force a specific mode.

Emits ​

NameParametersDescription
update:openbooleanEmitted when the menu should open or close.
select{ id: string; label: string; action?: () => void; groupName: string }Emitted when an item is selected.

Slots ​

NameDescription
—This component does not provide slots.

Basic Usage ​