Command
A command palette (⌘K / Ctrl+K) — search filtering, keyboard selection and Enter to execute. open is controlled: it can be set externally, and the global ⌘K shortcut or Esc closes it (closing fires oas-select / removes open).
Basic usage
Basic usage (open with ⌘K / Ctrl+K)
Controlled open
The open attribute is externally controlled: an external button sets open to open the palette; it closes via Esc / backdrop click / selecting a command (the component removes open; for controlled closing, the host decides whether to reopen after listening to oas-select).
When open, the backdrop covers the full screen, so no external "close" button is provided — use Esc / click the backdrop / select a command to close.
Externally controlled open
Groups and empty state
Group titles render from the group field; when nothing matches, an "no matching commands" empty state is shown.
Groups and empty state
API
Attributes
| Attribute | Description | Type | Default |
|---|---|---|---|
items | Command items JSON | string | [] |
open | Whether open (controlled; auto-removed after selection / Esc) | boolean | — |
Events
| Event | Description |
|---|---|
oas-select | A command was executed, detail: { value } |
CommandItem fields:
| Field | Description | Type |
|---|---|---|
label | Display text | string |
value | Selected value (oas-select detail.value) | string |
keywords | Search keywords (optional), matched in addition to the label | string[] |
group | Group name (optional); same-group items render a group title | string |
disabled | Disables the item (not selectable via Enter/click, skipped by arrow keys) | boolean |
Keyboard: ↑/↓ move the highlight (skipping disabled items), Enter executes and closes, Esc closes, Tab cycles between the search input and the options (focus trap); on open the search input is focused, and on close focus returns to the source element. The global ⌘K / Ctrl+K shortcut toggles it.