Sigil

Text edit

A multi-line text editor.

autofocus focuses it when it mounts; focus_when focuses it each time the signal changes. caret_rect receives the caret rectangle, relative to the editor's box, each time the caret moves, and None while the editor is disabled, so a popup can follow the caret.

GUITUIRuns in the browsertext_edit

Preview

Text edit, Default, light themeText edit, Default, dark theme

Usage example

fn text_edit_demo() -> TextEditBuilder {    text_edit(signal(String::from("Multi-line\neditable text."))).height(96.0)}
fn text_edit_demo() -> TextEditBuilder {  text_edit(signal(String::from(    "Multi-line\neditable text.",  )))  .height(96.0)}

States

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

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

API

NameSignaturePurpose
text_edit`fn text_edit(value: Signal<String>) -> TextEditBuilder`; `.autofocus()`, `.focus_when(Signal<u64>)`, `.caret_rect(Signal<Option<Rect>>)`A multi-line text editor. autofocus focuses it when it mounts; focus_when focuses it each time the signal changes. caret_rect receives the caret rectangle, relative to the editor's box, each time the caret moves, and None while the editor is disabled, so a popup can follow the caret.