Browse documentation
Command palette
Search actions from the keyboard and execute the selected command.
Import
Load the optional component layer before using the examples below.
Ruby
require "zaniah/ui"Commands
Provide label/action pairs or build it from registered application actions.
Rendered example

Ruby
commands = [["Open file", ->(*) { puts "Open" }],
["Close file", ->(*) { puts "Close" }]]
Zaniah::UI::CommandPalette.new(commands, open: true)
Application actions
from(app.actions) carries action titles, availability, and shortcut labels into the palette.
Ruby
Zaniah::UI::CommandPalette.from(app.actions)
API summary
Constructor options and behaviors are drawn from the component reference.
| Component | Constructor and methods | Variants or behavior |
|---|---|---|
CommandPalette | (commands, open:, placeholder:, matcher:); .from(app.actions) | searchable modal, Up/Down/Enter |
Accessibility
The palette is a dialog with a list. Up and Down move through matches; Enter runs the selected action.
| Component | Semantic role |
|---|---|
CommandPalette | dialog/list |