Duolith docs

ChipInput

A field that turns each entry into a chip when Enter is pressed, each with a remove button.

Stability: experimental

Props

PropTypeDefaultMeans
labelstringThe label above the field, and its accessible name.
valuesstring[]bindable([])The entries, in order; an entry already there is not added again. Bind it with bind:values={name}.
placeholderstringAdd and press EnterHint text while the field is empty.

States

StateLooks like
defaultA bordered box of chips with the field after them.

Accessibility

rolenone; a text field and a button per chip
nameThe label prop names the field; each remove button says which entry it removes.
focusTab reaches each remove button, then the field.
keyboardEnter adds what was typed; Enter and Space on a remove button remove its entry.

Theme tokens

color.border color.surface color.raised color.ink color.muted radius.full space.1 space.2 space.3 text.label text.caption text.body

Example

<ChipInput label="Tags" bind:values={tags} />