コマンドパレット
操作を検索して実行します。
使い方
明示的なトリガー、または任意の Mod+K ショートカットで開きます。説明付きのグループ結果と必要に応じた検索フィルターを渡します。
アクセシビリティ
矢印キー、Enter、Escape を使用します。明確な結果名と説明を提供します。
| プロパティ | 型 | 既定値 |
|---|---|---|
| items | readonly CommandPaletteItem[] | Required |
| open / defaultOpen | boolean | false |
| onOpenChange | (open: boolean) => void | None |
| shortcut | boolean | false |
| dismissLabel | string | None |
| maxResults | number | All |
| filter | (item, query) => boolean | Default 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: () => {} },
]}
/>