Command palette component with multi-step commands and scoped search.
Supports three modes:
- Commands (
/prefix) — multi-step action wizards with step progression - Search contexts (
:prefix) — scoped entity search - Global search (no prefix) — search across everything
Display Styles
Two display styles for command step progression:
"inline"(default) — Svelte-style, the input shows the full accumulated text like a sentence:/assign iPad Air to |. A command badge shows on the right. The editable portion is after the last prompt."tokens"— The input is cleared on each step. Previous selections show as colored token spans above the input.
Usage
<%!-- Inline style (default, matches Svelte) --%>
<.command_palette id="cmd" is_open={@cp_open} mode={@cp_mode} ... />
<%!-- Token style --%>
<.command_palette id="cmd" display="tokens" is_open={@cp_open} mode={@cp_mode} ... />
Summary
Functions
Attributes
id(:string) - Defaults to"command-palette".is_open(:boolean) - Defaults tofalse.query(:string) - Defaults to"".display(:string) - Step display style: inline (sentence in input) or tokens (spans above input). Defaults to"inline". Must be one of"inline", or"tokens".mode(:string) - Defaults to"idle". Must be one of"idle","command_list","command_step","context_list","context_search", or"global_search".commands(:list) - List of command maps. Defaults to[].contexts(:list) - List of search context maps. Defaults to[].results(:list) - Current items to display. Defaults to[].active_index(:integer) - Defaults to-1.is_loading(:boolean) - Defaults tofalse.current_command(:map) - Active command in step mode. Defaults tonil.current_step(:map) - Active step. Defaults tonil.current_step_index(:integer) - Defaults to0.total_steps(:integer) - Defaults to0.selections(:list) - Previous step selections as [%{step_id, label}]. Defaults to[].preview(:string) - Preview text for command. Defaults tonil.input_text(:string) - Full input text for inline display mode. Defaults to"".current_context(:map) - Active search context. Defaults tonil.page(:integer) - Defaults to1.total_pages(:integer) - Defaults to1.total_results(:integer) - Defaults to0.placeholder(:string) - Defaults tonil.empty_text(:string) - Defaults tonil.class(:string) - Defaults tonil.- Global attributes are accepted.