TagsInput
ui.widgets.TagsInputEnter many tokens from the keyboard.
BEHAVIOR CONTRACT
Comma / Enter commit, delete, focus and list updates all land on grapheme-safe boundaries.
RECORDED INTERACTION
The harness types “docs,” and it commits as a new tag.
// ── TagsInput ──
pub fn buildTagsInput(scope: *ui.Scope, cx: *ui.Cx) anyerror!*ui.Node {
const a = cx.allocator;
const c = try col(cx, 12);
const ti = try ui.widgets.TagsInput(.{
.initial_tags = &.{ "zig", "metal" },
.width = 380,
}, scope, cx);
ti.input.meta.ownership.meta.test_id = "story.tags.input";
ti.wrapper.meta.ownership.meta.test_id = "story.tags.wrapper";
try c.appendChild(a, ti.wrapper);
try c.appendChild(a, try label(cx, "End with comma (or click Add) to commit a tag."));
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.
TagsInputProps
ui.widgets.TagsInputfn mountTagsInput(props: TagsInputProps, scope: *Scope, cx: *Cx) !TagsInputMountField
Type
Default
Description
initial_tags[]const []const u8&.{}—
max_tagsusize16—
widthf32360—
placeholder[]const u8"Add tag, end with comma"—
on_change?core.HandlerRefnull—
TagsInputMount
ui.widgets.TagsInputField
Type
Default
Description
wrapper*Node—
—
state*TagsInputState—
—
input*Node—
—