VisorVisor
ComponentsForm

Tag Input

A multi-value tag input with removable chips and keyboard support.

Default

With Default Tags

ReactTypeScriptCSS

With Max Limit

ReactVue

Disabled

ReactTypeScript

Installation

npx visor add tag-input

This copies two files into your project:

  • components/ui/tag-input/tag-input.tsx — the component
  • components/ui/tag-input/tag-input.module.css — the styles

Usage

import { TagInput } from '@/components/ui/tag-input/tag-input';

<TagInput placeholder="Add skills..." onChange={(tags) => console.log(tags)} />

API Reference

TagInputProps

PropTypeDefaultDescription
valuestring[]Controlled array of tag strings.
defaultValuestring[]Default tags for uncontrolled usage.
onChange(tags: string[]) => voidCallback when the tag list changes.
placeholderstring'Add tag...'Placeholder text when no tags are entered.
maxnumberMaximum number of tags allowed.
disabledbooleanfalseDisables the tag input.

Accessibility

  • The input has role="combobox" with aria-expanded when suggestions are shown
  • Each tag chip has an associated remove button with aria-label="Remove [tag name]"
  • Keyboard: Enter or comma adds a tag; Backspace removes the last tag when input is empty; Delete removes a focused tag
  • Use an aria-label or associated <Label> to describe what kind of tags are expected (e.g., "Skills", "Topics")
  • When max is reached, the input is disabled and an aria-live region announces that the limit has been hit