命令面板

⌘K 呼出的命令面板,支持模糊搜索过滤,当前行带弹簧动效高亮,毛玻璃质感表面。

Press ⌘ J (or Ctrl J) to open.

安装

用 shadcn CLI 添加,或手动复制源码。

$ bunx --bun shadcn add @uilab/command-palette

API 参考

items
CommandItem[]
shortcut?
string

Opens with Cmd/Ctrl + this key. Default: "k"

k
placeholder?
string
Type a command or search…
emptyMessage?
string
No results found.
open?
boolean
onOpenChange?
((open: boolean) => void)

Keep in mind

Some components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.