API reference docs for the component. Learn about the props, CSS, and other APIs of this
exported module.
Whether to add a tag when you paste values into the tag input
Whether a tag can be edited after creation.
If `true` and focus is on a tag, pressing `Enter`or double clicking will edit the tag.
Whether to allow tags to exceed max. In this case,
we'll attach `data-invalid` to the root
Whether 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
- `"none"`: do nothing
- `"clear"`: clear the input value
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
The document's text/writing direction.
Whether the tags input should be disabled
The associate form of the underlying input element.
getRootNode
() => ShadowRoot | Node | Document
A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.
The unique identifier of the machine.
ids
Partial<{
root: string
input: string
clearBtn: string
label: string
control: string
tag(opts: TagProps): string
tagDeleteTrigger(opts: TagProps): string
tagInput(opts: TagProps): string
}>
The ids of the elements in the tags input. Useful for composition.
Whether the tags input is invalid
The max length of the input.
The name attribute for the input. Useful for form submissions
onFocusOutside
(event: FocusOutsideEvent) => void
Function called when the focus is moved outside the combobox
onHighlightChange
(details: HighlightChangeDetails) => void
Callback fired when a tag is highlighted by pointer or keyboard navigation
onInteractOutside
(event: InteractOutsideEvent) => void
Function called when an interaction happens outside the combobox
onPointerDownOutside
(event: PointerDownOutsideEvent) => void
Function called when the pointer is pressed down outside the combobox
onValueChange
(details: ValueChangeDetails) => void
Callback fired when the tag values is updated
onValueInvalid
(details: ValidityChangeDetails) => void
Callback fired when the max tag count is reached or the `validateTag` function returns `false`
Whether the tags input should be read-only
translations
IntlTranslations
Specifies the localized strings that identifies the accessibility elements and their states
validate
(details: ValidateArgs) => boolean
Returns a boolean that determines whether a tag can be added.
Useful for preventing duplicates or invalid tag values.
addValue
(value: string) => void
Function to add a tag to the tags.
clearInputValue
() => void
Function to clear the value of the tags entry input.
clearTriggerProps
Dict<any>
clearValue
(id?: string | undefined) => void
Function to clear the value of the tags.
Function to focus the tags entry input.
getTagDeleteTriggerProps
(options: TagProps) => Dict<any>
getTagInputProps
(options: TagProps) => Dict<any>
getTagProps
(options: TagProps) => Dict<any>
getTagState
(props: TagProps) => TagState
Returns the state of a tag
hiddenInputProps
Dict<any>
The value of the tags entry input.
Whether the tags have reached the max limit.
Whether the tags are empty
setInputValue
(value: string) => void
Function to set the value of the tags entry input.
setValue
(value: string[]) => void
Function to set the value of the tags.
setValueAtIndex
(index: number, value: string) => void
Function to set the value of a tag at the given index.
The value of the tags as an array of strings.
The value of the tags as a string.