Command Palette

The ArcadiaCommandPalette component provides a modal search overlay with keyboard-navigable command items.

Basic Usage

<ArcadiaCommandPalette @bind-Open="showPalette" OnSearch="HandleSearch">
    <ArcadiaCommandItem Label="New File" Shortcut="Ctrl+N" OnSelect="NewFile" />
    <ArcadiaCommandItem Label="Open Settings" Icon="gear" OnSelect="OpenSettings" />
    <ArcadiaCommandItem Label="Toggle Theme" Description="Switch between light and dark" OnSelect="ToggleTheme" />
</ArcadiaCommandPalette>

ArcadiaCommandPalette Parameters

ParameterTypeDefaultDescription
OpenboolfalseWhether the command palette is open. Supports two-way binding.
Placeholderstring"Search commands..."Placeholder text for the search input.
SearchTextstring""Current search text value. Supports two-way binding.
ChildContentRenderFragment?nullCommand item elements rendered inside the palette list.
Classstring?nullAdditional CSS class names.
Stylestring?nullInline CSS styles.

ArcadiaCommandPalette Events

EventTypeDescription
OpenChangedEventCallback<bool>Fired when the open state changes.
OnSearchEventCallback<string>Fired when the search input value changes.
SearchTextChangedEventCallback<string>Fired when SearchText changes (two-way binding).

ArcadiaCommandItem Parameters

ParameterTypeDefaultDescription
Labelstring""Display label for the command item.
Descriptionstring?nullOptional description shown below the label.
Shortcutstring?nullKeyboard shortcut hint displayed as a badge (e.g., "Ctrl+N").
Iconstring?nullOptional icon (emoji or text) displayed before the label.
DisabledboolfalseWhether the command item is disabled.
Classstring?nullAdditional CSS class names.
Stylestring?nullInline CSS styles.

ArcadiaCommandItem Events

EventTypeDescription
OnSelectEventCallbackFired when the command item is selected (clicked or Enter).

Accessibility

  • The palette uses role="dialog" with aria-modal="true" and aria-label="Command palette".
  • The search input uses role="combobox" with aria-expanded, aria-controls, aria-activedescendant, and aria-autocomplete="list".
  • The list uses role="listbox" and items use role="option" with aria-selected.
  • Keyboard navigation: Arrow Up/Down to navigate, Enter to select, Escape to close.
  • Auto-focuses the search input when opened.