Command
Command palette trigger
Press ⌘K
Usage
use maud_ui::primitives::command;
// Render the trigger button
let trigger = command::trigger("cmd-palette", "Command palette");
// Render the palette
let html = command::render(command::Props {
id: "cmd-palette".into(),
placeholder: "Type a command...".into(),
items: vec![
command::CommandItem { label: "New file".into(), shortcut: Some("Cmd+N".into()), group: Some("File".into()), disabled: false },
command::CommandItem { label: "Search".into(), shortcut: Some("Cmd+K".into()), group: Some("General".into()), disabled: false },
],
});