Skip to content

Tags List

Removable tag chips with an input and Add button for appending new tags. Submits as name[0], name[1], ... via hidden inputs.

Default Rendered example
Usage Example
@tagslist.TagsList(tagslist.Config{
    ID:          "tags",
    Name:        "tags",
    Values:      []string{"production", "gpu"},
    Placeholder: "Add a tag...",
})

Empty (Start Adding)

With no Values, the list starts empty and grows as the user adds tags.

Empty (Start Adding) Rendered example
Empty (Start Adding)
@tagslist.TagsList(tagslist.Config{
    ID:          "labels",
    Name:        "labels",
    Placeholder: "Add a label...",
    AddActionLabel:    "Add",
})

Disabled

Disabled: true renders read-only chips with no input or remove buttons.

Disabled Rendered example
Disabled
@tagslist.TagsList(tagslist.Config{
    ID:       "lockedTags",
    Name:     "locked",
    Values:   []string{"locked", "readonly"},
    Disabled: true,
})

Go API

v0.2.7

The examples above cover behavior and composition. pkg.go.dev is the canonical reference for exported types, functions, methods, and Go documentation.

github.com/araihu/goshtoso/components/tagslist
Open v0.2.7 API