Preview Updated 2026-05-10

Command palette

Cmd+K global command search with grouped lists, character match highlighting, and keyboard navigation.

Basic usage

Each entry in items can carry a group for automatic grouping and a shortcut for the right-aligned hint. Typed characters fuzzy-match against label / description / keywords, and matched characters are bolded in the accent color.

<CfCommandPalette
:open="open"
:items="items"
@update:open="(v) => open = v"
@select="(id) => onPick(id)"
/>
<CfCommandPalette
open={open}
onOpenChange={setOpen}
items={items}
onSelect={(id) => onPick(id)}
/>

hide-footer hides the bottom “up/down to navigate, enter to select, Esc to close” hint to save vertical space.

<CfCommandPalette ... hide-footer />
<CfCommandPalette ... hideFooter />

API

PropTypeDefaultDescription
open / v-model:openboolean
itemsCommandPaletteItem[]{ id, label, description?, group?, shortcut?, keywords?, disabled? }
placeholderstring'Search commands, requests, settings…'
emptyTextstring'No matches'
closeOnSelectbooleantrue
hideFooterbooleanfalse

Keyboard: up/down navigate, enter select, Esc close.

反馈与讨论

Command palette · Discussion

0
0 / 600
一键发送
正在加载评论...