Elements

Reference

Tags Input

TagsInput, dressed in the paper-and-ink system: one field vessel whose chips rest as quiet ink and lift only a tone when edited. The parts — Root, Label, Control, Input, ClearTrigger, Item, ItemPreview, ItemText, ItemInput, ItemDeleteTrigger, HiddenInput, Context.

Root · Label · Control · Input · ClearTrigger · Item · ItemPreview · ItemInput · ItemText · ItemDeleteTrigger

#ClearTrigger

A styled part — no props of its own; it takes the anatomy's shared styling.

#Control

A styled part — no props of its own; it takes the anatomy's shared styling.

#HiddenInput

A styled part — no props of its own; it takes the anatomy's shared styling.

#Input

A styled part — no props of its own; it takes the anatomy's shared styling.

#ItemContext

A styled part — no props of its own; it takes the anatomy's shared styling.

#ItemDeleteTrigger

A styled part — no props of its own; it takes the anatomy's shared styling.

#ItemInput

A styled part — no props of its own; it takes the anatomy's shared styling.

#ItemPreview

A styled part — no props of its own; it takes the anatomy's shared styling.

#ItemText

A styled part — no props of its own; it takes the anatomy's shared styling.

#Item

PropTypeDefaultDescription
disabledboolean | undefined—
indexstring | number—
valuestring—

#Label

A styled part — no props of its own; it takes the anatomy's shared styling.

#Root

PropTypeDefaultDescription
sizeString as PropType<"sm" | "md" | "lg">"md"One rung of the control-height ladder for the vessel at rest.
addOnPastebooleanfalseWhether to add a tag when you paste values into the tag input
allowDuplicatesbooleanfalseWhether to allow duplicate tags
allowOverflowbooleanWhether to allow tags to exceed max. In this case, we'll attach data-invalid to the root
autoFocusbooleanWhether the input should be auto-focused
blurBehavior'clear' | 'add'The behavior of the tags input when the input is blurred - "add": add the input value as a new tag - "clear": clear the input value
defaultInputValuestringThe initial tag input value when rendered. Use when you don't need to control the tag input value.
defaultValuestring[]The initial tag value when rendered. Use when you don't need to control the tag value.
delimiterstring | RegExp","The character that serves has: - event key to trigger the addition of a new tag - character used to split tags when pasting into the input
disabledbooleanWhether the tags input should be disabled
editablebooleantrueWhether a tag can be edited after creation, by pressing Enter or double clicking.
formstringThe associate form of the underlying input element.
idstringThe unique identifier of the machine.
idsPartial<{ root: string; input: string; hiddenInput: string; clearBtn: string; label: string; control: string; item(opts: tagsInput.ItemProps): string; itemDeleteTrigger(opts: tagsInput.ItemProps): string; itemInput(opts: tagsInput.ItemProps): string; }>The ids of the elements in the tags input. Useful for composition.
inputValuestringThe controlled tag input's value
invalidbooleanWhether the tags input is invalid
maxnumberInfinityThe max number of tags
maxLengthnumberThe max length of the input.
modelValuestring[]The v-model value of the tags input
namestringThe name attribute for the input. Useful for form submissions
placeholderstringThe placeholder text for the input when there are no tags
readOnlybooleanWhether the tags input should be read-only
requiredbooleanWhether the tags input is required
sanitizeValue(value: string) => stringFunction to sanitize the tag value before adding it
translationstagsInput.IntlTranslationsSpecifies the localized strings that identifies the accessibility elements and their states
validate(details: tagsInput.ValidateArgs) => booleanReturns a boolean that determines whether a tag can be added. Useful for preventing duplicates or invalid tag values.
EventPayload
valueChangedetails: ValueChangeDetails
update:modelValuevalue: string[]
focusOutsideevent: FocusOutsideEvent
interactOutsideevent: InteractOutsideEvent
pointerDownOutsideevent: PointerDownOutsideEvent
highlightChangedetails: HighlightChangeDetails
inputValueChangedetails: InputValueChangeDetails
update:inputValuevalue: string
valueInvaliddetails: ValidityChangeDetails