Sigil

Field

A label above a control.

.required marks the control required for screen readers and shows a marker after the label while it is true. .error shows the message under the control and paints the control invalid while it is Some. The control is marked invalid while an error shows and is described by the message.

GUITUIRuns in the browserfield

Preview

Field, Default, light themeField, Default, dark theme

Usage example

fn field_demo() -> FieldBuilder<TextFieldBuilder> {    field(        "Name",        text_field(signal(String::new())).placeholder("Full name"),    )}
fn field_demo()-> FieldBuilder<TextFieldBuilder> {  field(    "Name",    text_field(signal(String::new()))      .placeholder("Full name"),  )}

States

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

  • Field, Default, light themeField, Default, dark theme
    Default
  • Field, Hover, light themeField, Hover, dark theme
    Hover
  • Field, Pressed, light themeField, Pressed, dark theme
    Pressed
  • Field, Focused, light themeField, Focused, dark theme
    Focused

API

NameSignaturePurpose
field`fn field<C: IntoNode>(label, control: C) -> FieldBuilder<C>`; `.error(impl Reactive<Option<String>>)` when `C: FieldControl`; `.required(impl Reactive<bool>)`A label above a control. .required marks the control required for screen readers and shows a marker after the label while it is true. .error shows the message under the control and paints the control invalid while it is Some. The control is marked invalid while an error shows and is described by the message.