Sigil

Text field

A single-line text input.

leading and trailing place a node, such as an icon, inside the field border; the input fills the rest. clearable shows a clear button while the value is not empty; it empties the value, fires change, and puts focus back on the input.

GUITUIRuns in the browsertext_field

Preview

Text field, Default, light themeText field, Default, dark theme

Usage example

fn text_field_demo() -> TextFieldBuilder {    text_field(signal(String::from("Ada Lovelace"))).placeholder("Full name")}
fn text_field_demo() -> TextFieldBuilder{  text_field(signal(String::from(    "Ada Lovelace",  )))  .placeholder("Full name")}

States

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

  • Text field, Default, light themeText field, Default, dark theme
    Default
  • Text field, Hover, light themeText field, Hover, dark theme
    Hover
  • Text field, Pressed, light themeText field, Pressed, dark theme
    Pressed
  • Text field, Focused, light themeText field, Focused, dark theme
    Focused
  • Text field, Disabled, light themeText field, Disabled, dark theme
    Disabled
  • Text field, Invalid, light themeText field, Invalid, dark theme
    Invalid

API

NameSignaturePurpose
text_field`fn text_field(value: Signal<String>) -> TextFieldBuilder`; `.leading(node)`, `.trailing(node)`, `.clearable()`A single-line text input. leading and trailing place a node, such as an icon, inside the field border; the input fills the rest. clearable shows a clear button while the value is not empty; it empties the value, fires change, and puts focus back on the input.