TagInput

A multi-value text input that creates removable Chip tags on Enter or comma.

Live Demo

ReactTypeScript
MaxThree
DisabledTag

Props

PropTypeDefaultDescription
valuestring[]Controlled array of tag strings.
onChange(tags: string[]) => voidCallback receiving the updated tags array.
placeholderstring'Add tag…'Placeholder shown when no tags are present.
disabledbooleanfalseDisables the input.
maxTagsnumberMaximum number of tags allowed.

Usage

import { TagInput } from '@ghiberti85/ui'

const [tags, setTags] = useState(['React', 'TypeScript'])

<TagInput value={tags} onChange={setTags} placeholder="Add tag…" />

// With max limit
<TagInput maxTags={5} value={tags} onChange={setTags} />

// Disabled
<TagInput disabled value={['React']} />

View in Storybook

Open in Storybook
Ghiberti UI — Design System