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...",
})

Built-in text: the development API provides expressions.TagsList for application defaults, request preferences, and individual component overrides. Read the expression guide.

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.4.0

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.4.0 API