GitHub

Command Palette

A modal search overlay activated via Cmd+K with server-rendered results, keyboard navigation, and htmx integration.

<rhx-command-palette>

Examples

Basic (Static Results)

Item Variations (Icons, Descriptions, Shortcuts, Disabled)

htmx Integration (Server Search)

Press ⌘K / Ctrl+K to open, or click the button below.

Properties

Property Type Default Description
rhx-placeholder string "Search..." Input placeholder text
rhx-shortcut string "mod+k" Keyboard shortcut to open (mod = Cmd on Mac, Ctrl on Win/Linux)
rhx-debounce int 300 Debounce delay in milliseconds
rhx-min-chars int 1 Minimum characters before search fires
rhx-empty-message string "No results found" Message when results are empty
rhx-label string "Command palette" Accessible label for the dialog

Group Properties

Properties for <rhx-command-group> elements.

Properties

Property Type Default Description
rhx-heading string - Group heading text

Item Properties

Properties for <rhx-command-item> elements.

Properties

Property Type Default Description
rhx-value string - Item value passed on selection
rhx-href string? - Navigation URL on select
rhx-icon string? - Leading icon name
rhx-description string? - Secondary description text
rhx-shortcut string? - Display keyboard shortcut hint
rhx-disabled bool false Disabled state

Accessibility

  • The palette uses role="dialog" with aria-modal="true" for screen reader announcement.
  • The search input uses role="combobox" with aria-expanded and aria-autocomplete="list".
  • Results use role="listbox" with items as role="option".
  • Keyboard: ⌘K / Ctrl+K opens; Escape closes; Arrow keys navigate; Enter selects.
  • Groups use role="group" with aria-labelledby referencing the heading.
  • Disabled items have aria-disabled="true" and are skipped during keyboard navigation.