Command Palette
Keyboard-first command dialog with grouped, searchable actions.
Command palette uses a component for the overlay and typed command group data.
import {
KuiButtonDirective,
KuiCommandGroup,
KuiCommandItem,
KuiCommandPaletteComponent,
} from '@kikita-labs/ui';Control open and query with signals, and run commands from the selected output.
<div class="basic-command-palette-example">
<button kuiButton type="button" (click)="open.set(true)">Open command palette</button>
@if (selectedCommand(); as command) {
<p class="basic-command-palette-example__selection">Selected: {{ command }}</p>
}
<kui-command-palette
[(open)]="open"
[(query)]="query"
[groups]="groups"
(selected)="runCommand($event)"
/>
</div>Items support metadata for rendering and keywords for search matching.
const groups: readonly KuiCommandGroup[] = [
{
heading: 'Project',
items: [
{
id: 'rename',
label: 'Rename project',
description: 'Update the display name.',
meta: 'Project',
badge: 'New',
shortcut: ['F2'],
icon: 'R',
keywords: ['edit', 'title'],
},
{
id: 'delete',
label: 'Delete project',
danger: true,
disabled: true,
},
],
},
];Inputs and outputs verified against @kikita-labs/ui v1.6.1 public typings.
| Name | Type | Default | Description |
|---|---|---|---|
| open | ModelSignal<boolean> | — | Two-way model controlling overlay visibility. |
| groups | readonly KuiCommandGroup[] | — | Command groups rendered in the list. |
| loading | boolean | — | Renders skeleton rows and sets aria-busy. |
| placeholder | string | — | Search input placeholder. |
| label | string | — | Accessible label for the modal dialog and search input. |
| emptyText | string | — | Empty-state title when no command matches. |
| query | ModelSignal<string> | — | Two-way model for the current search value. |
| selected | OutputEmitterRef<KuiCommandItem> | — | Emits the selected command item. |
The palette uses modal dialog semantics, focus trapping, and listbox navigation.
- The palette renders through a CDK overlay with scroll blocking and a modal dialog container. Set
labelto describe the dialog and search input for screen readers. - A CDK focus trap keeps focus inside the palette while open. Focus returns to the element that opened the palette after it closes.
- The search input exposes combobox and listbox relationships through
aria-controlsandaria-activedescendant. - Arrow keys move the active option;
Enterselects it. Escapecloses the palette and restores focus.- Disabled commands are skipped by keyboard navigation and cannot be selected.
- Setting
loadingrenders skeleton rows and setsaria-busyon the list while results are pending. - Formal assistive-technology review is still pending for Command Palette per
state-coverage.md; only static and browser smoke review have been completed so far.