Actions & Overlays
Command Palette
A filterable list of commands with keyboard navigation.
A filterable list of commands with keyboard navigation and an empty state. Render it inline, or drop it inside a <dialog> and open it with a hotkey.
Command palette
Type to filter, navigate with ↑/↓, and run with Enter.
No results found.
Actions
New File
Open…
Navigation
Go to Settings
Open Docs
JavaScript
This component ships an optional enhancer. With auto-init it loads automatically; to wire it yourself, import it directly:
import { enhanceCommand } from '@hydrateless/enhancers/command';
const handle = enhanceCommand(container, { hotkey, onCommand });
// handle.api -> imperative controls
// handle.destroy() -> tear everything downProps
The framework bindings expose these props (and forward the rest to the root element).
| Prop | Type | Default | Description |
|---|---|---|---|
onSelect | (value: string) => void | — | Fires when a command runs. |
hotkey | string | — | Key that opens the palette when wrapped in a dialog, e.g. `"k"`. |
Events and callbacks
| Event / Callback | Payload | Description |
|---|---|---|
hl:command | { value: string; item: HTMLElement } | Cancelable CustomEvent when a command runs; `preventDefault()` to handle navigation yourself. |
CSS variables
Override these on any ancestor to theme the component. See the theme studio to preview changes live.
| CSS variable | Used for |
|---|---|
--hl-surface | Palette background. |
--hl-border | Palette border. |
--hl-primary | Active item highlight. |
Accessibility
- The input is
role="combobox"controlling therole="listbox", tracked witharia-activedescendant. - Filtering matches visible text plus any
data-hl-keywords.