Sigil

Command menu

A command palette.

Typing in its query field filters and ranks items with fuzzy_score; Up and Down move, Enter or a click runs an item or opens a submenu, and Escape goes back one level.

GUITUIRuns in the browsercommand_menu

Preview

Command menu, Default, light themeCommand menu, Default, dark theme

Usage example

fn command_menu_demo() -> CommandMenuBuilder {    command_menu()        .item("Refresh", || {})        .item("Open settings", || {})        .disabled("Publish")        .submenu("Export", |sub| sub.item("PNG", || {}).item("SVG", || {}))}
fn command_menu_demo()-> CommandMenuBuilder {  command_menu()    .item("Refresh", || {})    .item("Open settings", || {})    .disabled("Publish")    .submenu("Export", |sub| {      sub        .item("PNG", || {})        .item("SVG", || {})    })}

States

All 4 captured states, each drawn by the window host and by the terminal host.

  • Command menu, Default, light themeCommand menu, Default, dark theme
    Default
  • Command menu, Hover, light themeCommand menu, Hover, dark theme
    Hover
  • Command menu, Pressed, light themeCommand menu, Pressed, dark theme
    Pressed
  • Command menu, Focused, light themeCommand menu, Focused, dark theme
    Focused

API

NameSignaturePurpose
command_menufn command_menu() -> CommandMenuBuilderA command palette. Typing in its query field filters and ranks items with fuzzy_score; Up and Down move, Enter or a click runs an item or opens a submenu, and Escape goes back one level.