Skip to content

DynamicTags

Type in the input and press Enter/comma to create tags; supports deduplication, a maximum limit, and keyboard deletion.

Basic Usage

Deduplicate by default

model-value is a JSON array attribute; duplicate tags are not allowed by default.

Allow Duplicates

allow-duplicate

max Limit

max=3

When max is reached, the input is automatically disabled; deleting a tag restores input.

Placeholder & Disabled

placeholder

disabled

Events

Add/remove events

Listen to oas-add / oas-remove / oas-change:

API

Attributes

AttributeDescriptionTypeDefault
allow-duplicateAllow duplicate tagsboolean
disabledDisabledboolean
maxMaximum number of tagsstring
model-valueTag array (property or JSON)string[][]
placeholderInput placeholderstring

Events

EventDescription
oas-addTag added, detail: { value }
oas-changeDispatched after add/remove, detail: { value }
oas-removeTag removed, detail: { value }

Keyboard: Enter / , to submit; with the input empty, Backspace deletes the last tag.

ARIA: the container has role="list", tags have role="listitem", remove buttons are focusable with an aria-label; when submitting a duplicate, the input is marked aria-invalid with a hint shown.