Textarea
ui.widgets.TextareaMulti-line editing with helper, error and disabled states.
BEHAVIOR CONTRACT
Line breaks, selection, scrolling, grapheme boundaries and IME preedit / commit match the single-line input.
RECORDED INTERACTION
The harness focuses the box and writes two lines.
// ── Textarea ──
pub fn buildTextarea(scope: *ui.Scope, cx: *ui.Cx) anyerror!*ui.Node {
const a = cx.allocator;
const c = try col(cx, 12);
const ta = try W.Textarea(.{ .label_text = "Notes", .placeholder = "Write something…", .rows = 5, .width = 420 }).mount(scope, cx);
ta.meta.ownership.meta.test_id = "story.textarea.box";
try c.appendChild(a, ta);
try c.appendChild(a, try W.Textarea(.{ .label_text = "With helper", .placeholder = "Bio", .helper = "Max 500 characters", .rows = 3, .width = 420 }).mount(scope, cx));
try c.appendChild(a, try W.Textarea(.{ .label_text = "With error", .value = "too short", .error_msg = "Please write more", .rows = 3, .width = 420 }).mount(scope, cx));
try c.appendChild(a, try W.Textarea(.{ .label_text = "Disabled", .placeholder = "Cannot edit", .disabled = true, .rows = 3, .width = 420 }).mount(scope, cx));
return c;
}The story's verbatim source from the Storybook (zenit 4c50245 2026-10-01). W is ui.widgets; col / row / label are small Storybook layout helpers.
TextareaProps
ui.widgets.Textareafn Textarea(props: TextareaProps) TextareaBuilderField
Type
Default
Description
value?[]const u8null—
placeholder?[]const u8null—
label_text?[]const u8null—
helper?[]const u8null—
error_msg?[]const u8null—
rowsu324—
disabledboolfalse—
requiredboolfalse—
readonlyboolfalse—
width?f32null—
on_change?core_ui.HandlerRefnull—
context?*anyopaquenull—
*Node
ui.widgets.Textareamount returns *Node directly. Append it to a parent.