---
title: "Componente TagsInput — zenit Zig UI"
description: "Introduce muchos tokens desde el teclado. La confirmación con coma / Enter, el borrado, el foco y las actualizaciones de la lista respetan los límites de…"
url: https://zenit.z.express/es/components/tags
language: es
alternate_en: https://zenit.z.express/components/tags.md
alternate_zh: https://zenit.z.express/zh/components/tags.md
alternate_ja: https://zenit.z.express/ja/components/tags.md
alternate_ko: https://zenit.z.express/ko/components/tags.md
alternate_fr: https://zenit.z.express/fr/components/tags.md
alternate_de: https://zenit.z.express/de/components/tags.md
project: zenit v0.1.0-alpha (Zig 0.15.2, macOS)
source: https://github.com/version-next/zenit
---

# TagsInput

`ui.widgets.TagsInput`

Introduce muchos tokens desde el teclado.

[Video](https://zenit.z.express/media/stories/tags.mp4?v=85989d0ec2)

**BEHAVIOR CONTRACT**

La confirmación con coma / Enter, el borrado, el foco y las actualizaciones de la lista respetan los límites de grafema.

**RECORDED INTERACTION**

El harness escribe “docs,” y se confirma como una etiqueta nueva.

`examples/storybook/stories.zig:3042`

```zig
// ── 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;
}
```

[Ver el código en GitHubexamples/storybook/stories.zig:3042](https://github.com/version-next/zenit/blob/HEAD/examples/storybook/stories.zig#L3042)

El código literal de la story en el Storybook (zenit 5f9add5+wip 2026-09-30). `W` es `ui.widgets`; `col` / `row` / `label` son pequeños helpers de layout del Storybook.

### TagsInputProps

`ui.widgets.TagsInput`

[src/ui/components/tags\_input/mod.zig:21](https://github.com/version-next/zenit/blob/HEAD/src/ui/components/tags_input/mod.zig#L21)

```zig
fn mountTagsInput(props: TagsInputProps, scope: *Scope, cx: *Cx) !TagsInputMount
```

| Campo | Tipo | Predeterminado | Descripción |
| --- | --- | --- | --- |
| `initial_tags` | `[]const []const u8` | `&.{}` | — |
| `max_tags` | `usize` | `16` | — |
| `width` | `f32` | `360` | — |
| `placeholder` | `[]const u8` | `"Add tag, end with comma"` | — |
| `on_change` | `?core.HandlerRef` | `null` | — |

### TagsInputMount

`ui.widgets.TagsInput`

[src/ui/components/tags\_input/mod.zig:229](https://github.com/version-next/zenit/blob/HEAD/src/ui/components/tags_input/mod.zig#L229)

| Campo | Tipo | Predeterminado | Descripción |
| --- | --- | --- | --- |
| `wrapper` | `*Node` | — | — |
| `state` | `*TagsInputState` | — | — |
| `input` | `*Node` | — | — |
