---
title: "TagsInput 컴포넌트 — zenit Zig UI"
description: "키보드로 여러 token을 연속 입력합니다.쉼표 / Enter 확정, 삭제, 포커스, tag 목록 갱신이 모두 자소 경계를 안전하게 지킵니다."
url: https://zenit.z.express/ko/components/tags
language: ko
alternate_en: https://zenit.z.express/components/tags.md
alternate_zh: https://zenit.z.express/zh/components/tags.md
alternate_es: https://zenit.z.express/es/components/tags.md
alternate_ja: https://zenit.z.express/ja/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`

키보드로 여러 token을 연속 입력합니다.

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

**BEHAVIOR CONTRACT**

쉼표 / Enter 확정, 삭제, 포커스, tag 목록 갱신이 모두 자소 경계를 안전하게 지킵니다.

**RECORDED INTERACTION**

harness가 “docs,”를 입력하면 새 tag로 확정됩니다.

`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;
}
```

[GitHub에서 소스 보기examples/storybook/stories.zig:3042](https://github.com/version-next/zenit/blob/HEAD/examples/storybook/stories.zig#L3042)

Storybook에 있는 이 story의 원본 코드입니다(zenit 5f9add5+wip 2026-09-30). `W`는 `ui.widgets`이며, `col` / `row` / `label`은 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
```

| 필드 | 타입 | 기본값 | 설명 |
| --- | --- | --- | --- |
| `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)

| 필드 | 타입 | 기본값 | 설명 |
| --- | --- | --- | --- |
| `wrapper` | `*Node` | — | — |
| `state` | `*TagsInputState` | — | — |
| `input` | `*Node` | — | — |
