MindeesUI
ComponentsForms

TagInput

A field that turns submitted text into removable chips, with dedupe, a max-tag cap, and backspace removal.

TagInput shows the current tags as removable chips above an Input. Submitting the field commits the trimmed draft as a new tag; pressing backspace on an empty field removes the last tag. Duplicates are blocked by default and a maxTags cap can be set.

Import

import { TagInput } from '@mindees/ui';

Usage

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

Props

PropTypeDefaultDescription
valuereadonly string[][]Current tags.
onChange(value: string[]) => voidFired with the full next array of tags after add/remove.
dedupebooleantrueBlock duplicate tags (case-insensitive).
maxTagsnumberCap on the number of tags.
placeholderstring'Add tag…'Placeholder for the inner text field.
size'sm' | 'md' | 'lg''md'Inner input size.
invalidbooleaninheritedForce an invalid state outside of a FormField.
disabledbooleaninheritedForce a disabled state outside of a FormField.
inputAccessibilityLabelstringAccessible label for the inner text field.
styleStyleProp<ViewStyle>Style applied to the field container.

Accessibility

Each tag is a Chip with a remove control (hidden when disabled). Supply inputAccessibilityLabel to name the text field; inside a FormField the invalid and disabled states are inherited from context.

On this page