Command palette
A dialog with a search box over every command in the app, opened with ⌘K. Each command holds a real link or button_to form, so frames and confirms work as they do anywhere; more commands arrive from src: as you type.
Open it
Press the shortcut, or the button. Type "kiln" for a remote result.
This example talks to a server
These are static pages, so what this example saves, posts or searches for won't answer here. Run the browser
(
bin/dev) or mount it in an app to try it for real.
<%= command_palette id: "demo_palette", src: search_commands_path do |palette| %>
<% palette.group "Go to" do |group| %>
<% group.link "Overview", root_path, keywords: "home start", shortcut: %w[G O], icon: :file %>
<% group.link "Installation", installation_path, icon: :wrench %>
<% group.link "Theming", theming_path, icon: :lightbulb %>
<% end %>
<% palette.group "Actions" do |group| %>
<% group.link "Edit profile", profile_dialog_path, data: { turbo_frame: "modal" }, icon: :pencil %>
<% group.button "Reset profile", profile_dialog_path, method: :delete, form: { data: { turbo_confirm: "Reset the profile?" } }, icon: :x %>
<% end %>
<% end %>
<%= command_palette_button dialog: "demo_palette" %>