R

TagsInput

6 parts

Anatomy

Import the parts and compose them. Each part forwards attributes to its underlying element.

vue
import {
  TagsInputRoot,
  TagsInputItem,
  TagsInputItemText,
  TagsInputItemDelete,
  TagsInputInput,
  TagsInputClear,
} from '@robonen/primitives/tags-input';

<TagsInputRoot>
  <TagsInputItem />
  <TagsInputItemText />
  <TagsInputItemDelete />
  <TagsInputInput />
  <TagsInputClear />
</TagsInputRoot>

API Reference

TagsInputRoot

Root
PropTypeDescription
modelValue?U[]Controlled value. Use `v-model`.
defaultValue?U[]Uncontrolled initial value.
addOnPaste?booleanAdd on paste (respects `delimiter`).
addOnTab?booleanAdd on Tab.
addOnBlur?booleanAdd on blur.
duplicate?booleanAllow duplicate tags.
disabled?booleanDisable the whole component.
delimiter?string | RegExpCharacter or regex that splits/commits input.
dir?'ltr' | 'rtl'Writing direction. Falls back to `ConfigProvider` when omitted.
max?numberMaximum number of tags. `0` disables the cap.
convertValue?(raw: string) => UMap a raw input string to a tag. Required for non-string tag values.
displayValue?(value: U) => stringRender a tag value as text.

TagsInputItem

Item
PropTypeDescription
valueUThe value associated with this tag.
disabled?booleanDisable this specific tag.

TagsInputItemText

ItemText

No props or events — renders its element and forwards attributes.

TagsInputItemDelete

ItemDelete

No props or events — renders its element and forwards attributes.

TagsInputInput

Input
PropTypeDescription
placeholder?stringPlaceholder text.
autoFocus?booleanFocus on mount.
maxLength?numberMax input length.

TagsInputClear

Clear

No props or events — renders its element and forwards attributes.