Command Palette
⌘K command palette overlay. Filterable list of actions, grouped with keyboard navigation.
overlay command
Usage
// 1. Place Command anywhere on the page
overlay.Command(overlay.CommandProps{
Items: []overlay.CommandItem{
{Label: "Go to Dashboard", Icon: "lucide:home", Href: "/", Group: "Navigate"},
{Label: "New Project", Icon: "lucide:plus", OnClick: "openNewProject()", Group: "Actions"},
},
})
// 2. Open via Datastar signal or button
primitive.Button(..., g.Attr("data-on:click", "$_cmdOpen=true"), g.Text("⌘K"))
// Keyboard: Ctrl/⌘+K opens, Escape closes.