Sigil

Icon button

A button that shows one glyph: text or an Icon.

An icon's name is the accessible name.

GUITUIRuns in the browsericon_button

Preview

Icon button, Default, light themeIcon button, Default, dark theme

Usage example

fn icon_button_demo() -> ButtonBuilder {    icon_button("×", || {}).accessible("Reset")}
fn icon_button_demo() -> ButtonBuilder {  icon_button("×", || {})    .accessible("Reset")}

States

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

  • Icon button, Default, light themeIcon button, Default, dark theme
    Default
  • Icon button, Hover, light themeIcon button, Hover, dark theme
    Hover
  • Icon button, Pressed, light themeIcon button, Pressed, dark theme
    Pressed
  • Icon button, Focused, light themeIcon button, Focused, dark theme
    Focused
  • Icon button, Disabled, light themeIcon button, Disabled, dark theme
    Disabled

API

NameSignaturePurpose
icon_buttonfn icon_button(glyph: impl Into<ButtonGlyph>, activate: impl Fn() + 'static) -> ButtonBuilderA button that shows one glyph: text or an Icon. An icon's name is the accessible name.