-
Notifications
You must be signed in to change notification settings - Fork 9
Component TextArea
MeowLynxSea edited this page Jun 13, 2026
·
4 revisions
A multi-line text input. Paste keeps newlines (unlike text_input, which replaces them with spaces).
use yororen_ui::headless::text_area::text_area;use yororen_ui::headless::text_area::text_area;
text_area("bio")
.placeholder("Tell us about yourself…")
.max_length(2048)
.on_change({
let entity = cx.entity();
move |new: &str, _window, cx| {
entity.update(cx, |s, _cx| s.bio = new.to_string());
}
})
.render(cx, window)| Method | Purpose |
|---|---|
placeholder(text) |
Hint shown when empty. |
max_length(n) |
Hard cap on the value's UTF-8 byte length. |
disabled(v) |
Disable interaction. |
on_change(closure) |
Fn(&str, &mut Window, &mut App) + 'static + Send + Sync. |
has_custom_bg(v) / custom_bg(hsla)
|
Override the background. |
has_custom_border(v) / custom_border(hsla)
|
Override the border. |
has_custom_focus_border(v) / custom_focus_border(hsla)
|
Override the focus border. |
custom_text_color(hsla) |
Override the text color. |
-
Factory takes
(id)only — nocxargument. -
.render(cx, window)is two-arg and returnsAnyElement. Thewindowis required for IME / paste. - Paste with newlines is preserved;
text_inputstrips them. -
on_changereceives&str, notSharedString. Convert with.to_string(). - The state is minted internally by the renderer via
window.use_keyed_state(...).
TextInput, SearchInput, Form
Yororen UI v0.3.0 · repository · Apache-2.0 · This wiki documents Yororen UI v0.3.0.
This wiki documents Yororen UI v0.3.0 — the headless-core, swappable-renderer build.