TagsInput
ui.widgets.TagsInputViele Tokens per Tastatur eingeben.
BEHAVIOR CONTRACT
Übernahme per Komma / Enter, Löschen, Fokus und Listenaktualisierung erfolgen alle an graphemsicheren Grenzen.
RECORDED INTERACTION
Der Harness tippt „docs,“ und es wird als neuer Tag übernommen.
// ── 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;
}Der unveränderte Quellcode der Story aus dem Storybook (zenit 5f9add5+wip 2026-09-30). W steht für ui.widgets; col / row / label sind kleine Layout-Helfer des Storybooks.
TagsInputProps
ui.widgets.TagsInputfn mountTagsInput(props: TagsInputProps, scope: *Scope, cx: *Cx) !TagsInputMountFeld
Typ
Standard
Beschreibung
initial_tags[]const []const u8&.{}—
max_tagsusize16—
widthf32360—
placeholder[]const u8"Add tag, end with comma"—
on_change?core.HandlerRefnull—
TagsInputMount
ui.widgets.TagsInputFeld
Typ
Standard
Beschreibung
wrapper*Node—
—
state*TagsInputState—
—
input*Node—
—