Sigil

Toggle

An on/off switch.

GUITUIRuns in the browsertoggle

Preview

Toggle, Default, light themeToggle, Default, dark theme

Usage example

fn toggle_demo() -> ToggleBuilder {    toggle(signal(true)).label("Locked")}

States

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

Default

  • Toggle, Default, light themeToggle, Default, dark theme
    Default
  • Toggle, Hover, light themeToggle, Hover, dark theme
    Hover
  • Toggle, Pressed, light themeToggle, Pressed, dark theme
    Pressed
  • Toggle, Focused, light themeToggle, Focused, dark theme
    Focused
  • Toggle, Disabled, light themeToggle, Disabled, dark theme
    Disabled

Off

  • Toggle, Off: Default, light themeToggle, Off: Default, dark theme
    Default
  • Toggle, Off: Hover, light themeToggle, Off: Hover, dark theme
    Hover
  • Toggle, Off: Pressed, light themeToggle, Off: Pressed, dark theme
    Pressed
  • Toggle, Off: Focused, light themeToggle, Off: Focused, dark theme
    Focused
  • Toggle, Off: Disabled, light themeToggle, Off: Disabled, dark theme
    Disabled

API

NameSignaturePurpose
toggleconst fn toggle(on: Signal<bool>) -> ToggleBuilderAn on/off switch.