Sigil

Dropdown

A select box.

The trigger fills the width of its parent, like a form field; in a toolbar row give it .width(..).

GUITUIRuns in the browserdropdown

Preview

Dropdown, Open, light themeDropdown, Open, dark theme

Usage example

fn dropdown_demo() -> DropdownBuilder {    dropdown(        signal(1_usize),        vec!["Small".into(), "Medium".into(), "Large".into()],    )}
fn dropdown_demo() -> DropdownBuilder {  dropdown(    signal(1_usize),    vec![      "Small".into(),      "Medium".into(),      "Large".into(),    ],  )}

States

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

  • Dropdown, Default, light themeDropdown, Default, dark theme
    Default
  • Dropdown, Hover, light themeDropdown, Hover, dark theme
    Hover
  • Dropdown, Pressed, light themeDropdown, Pressed, dark theme
    Pressed
  • Dropdown, Focused, light themeDropdown, Focused, dark theme
    Focused
  • Dropdown, Disabled, light themeDropdown, Disabled, dark theme
    Disabled
  • Dropdown, Open, light themeDropdown, Open, dark theme
    Open

API

NameSignaturePurpose
dropdownfn dropdown(selected: Signal<usize>, options: Vec<String>) -> DropdownBuilderA select box. The trigger fills the width of its parent, like a form field; in a toolbar row give it .width(..).