Forms

Tag Input

A field that turns typed values into removable tags: Enter or comma adds, Backspace removes the last, pasted lists are split.
import { TagInput } from "pleate/tag-input";

Limit and validation

LisbonSintra

marta@plate.app

Sizes and disabled

FoodMuseums

FoodMuseums

FoodMuseums

Beaches

Props

value / defaultValue / onValueChange

Controlled or uncontrolled tags.

string[]

validate

Return true to accept; false or a message to reject (shown under the field).

(tag, current) => boolean | string

max

Most tags allowed; the field locks when reached.

number

addOnBlur

Add the typed text when focus leaves.

booleandefault true

name

Submits the tags as one comma-separated value.

string

variant / size / invalid / disabled

Same as Input.

Accessibility

  • Each remove button is named "Remove <tag>".
  • Rejections are announced through a status region and set aria-invalid.
  • Duplicates are ignored case-insensitively.
  • Name the field with a label (htmlFor + id) or aria-label.