Oddmash UI
所有组件

命令面板

查找并执行操作。

用法

通过明确的触发器或可选的 Mod+K 快捷键打开,传入带描述的分组结果和所需的搜索过滤器。

无障碍

使用方向键、Enter 和 Escape。提供清晰的结果名称与描述。

属性类型默认值
itemsreadonly CommandPaletteItem[]Required
open / defaultOpenbooleanfalse
onOpenChange(open: boolean) => voidNone
shortcutbooleanfalse
dismissLabelstringNone
maxResultsnumberAll
filter(item, query) => booleanDefault matching
<CommandPalette
  trigger={<Button>Commands</Button>}
  title="Commands"
  description="Choose an action"
  searchLabel="Search commands"
  emptyLabel="No commands found"
  dismissLabel="Close commands"
  items={[
    { id: 'save', label: 'Save project', group: 'Project', description: 'Save current changes', onSelect: () => {} },
    { id: 'guide', label: 'Usage guide', group: 'Documentation', onSelect: () => {} },
  ]}
/>

交互式文档