How to build an accessible TagsInput in React

The typing surface is a real <input> and each tag exposes a dedicated remove button with an aria-label naming the tag, so screen-reader users can both add (Enter/comma) and delete (Backspace or the button) without ambiguity.

When to use a TagsInput

When not to use it

Keyboard interactions

Role textbox, verified at WCAG 2.2-AA.

Common mistakes

Avoid: <TagsInput value={selectedRoles} ... /> // roles are a fixed enum

Prefer: <MultiSelect options={roleOptions} />

Free-text entry invites typos and inconsistent values when the set is actually constrained; pick from options instead

Example

<TagsInput value={['react', 'vue']} onValueChange={() => {}} placeholder="Add tag…" />

See the full TagsInput reference →