Skip to content

Component TextInput

MeowLynxSea edited this page Jan 23, 2026 · 10 revisions

TextInput

Single-line text input.

Example

use gpui::ElementId;
use yororen_ui::component::text_input;

let input = text_input()
    .key(ElementId::from((ElementId::from("settings"), "username")))
    .placeholder("Username")
    .on_change(|value, _window, _cx| {
        // value: SharedString
        // ...
    });

Notes

  • TextInput owns internal cursor/selection state, so stable key(...) is recommended in lists.

Clone this wiki locally