Tags List

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

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)
@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
@tagslist.TagsList(tagslist.Config{
    ID:       "lockedTags",
    Name:     "locked",
    Values:   []string{"locked", "readonly"},
    Disabled: true,
})

API Reference

PropTypeDefaultDescription
IDstring""Unique id for the tags-list root and input.
Namestring""Base form field name (submits as name[0], name[1], ...).
Values[]stringnilInitial tag values.
Placeholderstring""Input placeholder.
AddActionLabelstring"Add"Label of the add button.
DisabledboolfalseRender read-only chips (no input/remove).
RootClassstring""Extra classes on the container.