Skip to content

TagInput

<ts-tag-input> vv0.6.3

The ts-tag-input component.

Open in Storybook for interactive demos.

<ts-tag-input size="md" value="[]"></ts-tag-input>
PropertyAttributeTypeDefaultDescription
allowDuplicatesallow-duplicatesbooleanfalseWhether to allow duplicate tags.
disableddisabledbooleanfalseRenders the input as disabled.
errorerrorstring | undefinedError message — renders the input in an error state.
helpTexthelp-textstring | undefinedHelp text displayed below the input.
labellabelstringLabel text displayed above the input.
maxTagsmax-tagsnumber | undefinedMaximum number of tags allowed.
placeholderplaceholderstring | undefinedPlaceholder text for the input.
sizesize"lg" | "md" | "sm" | "xl" | "xs"'md'The input’s size.
valuestring[][]The current list of tags.
EventDetailBubblesComposedDescription
tsChange\{ value: string[]; \}YesYesEmitted when the tag list changes.
tsInput\{ inputValue: string; \}YesYesEmitted on each keystroke in the input.

Use ::part() to style internal elements:

PartDescription
baseThe outer wrapper containing tags and input.
error-textThe error message wrapper.
help-textThe help text wrapper.
inputThe native text input.
labelThe label element.
tagA tag chip element.
tag-removeThe remove button inside a tag.
ts-tag-input::part(base) {
/* your custom styles */
}
<ts-tag-input size="md" value="[]"></ts-tag-input>
import { TsTagInput } from '@tessera-ui/react';
<TsTagInput size="md" value="[]"></TsTagInput>