Reference

TagInput

Words typed into a field, each a chip once Enter or a comma ends it; Backspace in the empty field takes the last back, and each chip has a button to take it out.

TagInput(bind: State, label: String, placeholder: String)

Since 6.2.0

label

placeholder

designfrontend

2 tag(s): design, frontend

Example

wf

state tags: [String] = ["design", "frontend"] TagInput(bind: tags, label: "Tags", placeholder: "Type a tag, then Enter") Text("{tags.length} tag(s): {tags.join(", ")}").muted

Props

Props of TagInput
PropTypeUnsetMeaning

bind:

State (required)

—

The [String] state it reads and writes: the words, in the order added; a word already there is not added again

label:

String (required)

—

What the words are: the field's name for a screen reader

placeholder:

String

none

Shown while the field is empty

Attribute families: global, aria, data. Plus the 22 universal props every element takes: animate:, exit:, speed:, duration:, delay:, easing:, stagger:, on:, count:, shared:, class:, ref:, drag:, dragGroup:, dropValue:, dropAxis:, dropInside:, roving:, trapFocus:, mount:, update:, cleanup:.

Flags and cases

A flag is written after the parentheses with a dot: a Bool prop, or a case of one of the element's enum props. A case the enum lacks is an error with a hint.

No flags of its own.

Events

Every element also takes the props, the events and the attribute families listed on every element.

Slots

It takes no slots.

Renders with the class wf-tag-input, stable across releases, so a stylesheet may target it.