Tags Input
A component that allows users to add tags to an input field.
A component that allows users to add tags to an input field.
To set up the tags input correctly, you’ll need to understand its anatomy and how we name its parts.
Each part includes a
data-part
attribute to help identify them in the DOM.
Learn how to use the TagsInput
component in your project. Let’s take a look at
the most basic example:
import { TagsInput } from '@ark-ui/react'
const Basic = () => {
return (
<TagsInput.Root>
{(api) => (
<>
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
{api.value.map((value, index) => (
<TagsInput.Item key={index} index={index} value={value}>
<TagsInput.ItemPreview>
<TagsInput.ItemText>{value}</TagsInput.ItemText>
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.ItemPreview>
<TagsInput.ItemInput />
</TagsInput.Item>
))}
</TagsInput.Control>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</>
)}
</TagsInput.Root>
)
}
import { TagsInput } from '@ark-ui/solid'
import { Index } from 'solid-js'
const Basic = () => (
<TagsInput.Root>
{(api) => (
<>
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
<Index each={api().value}>
{(value, index) => (
<TagsInput.Item index={index} value={value()}>
<TagsInput.ItemPreview>
<TagsInput.ItemText>{value()}</TagsInput.ItemText>
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.ItemPreview>
<TagsInput.ItemInput />
</TagsInput.Item>
)}
</Index>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear All</TagsInput.ClearTrigger>
</TagsInput.Control>
</>
)}
</TagsInput.Root>
)
<script setup lang="ts">
import { ref } from 'vue'
import { TagsInput } from '@ark-ui/vue'
const frameworks = ref(['React', 'Solid', 'Vue'])
</script>
<template>
<TagsInput.Root v-slot="api">
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
<TagsInput.Item
v-for="(value, index) in api.value"
:key="index"
:index="index"
:value="value"
>
<TagsInput.ItemPreview>
<TagsInput.ItemText>{{ value }}</TagsInput.ItemText>
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.ItemPreview>
<TagsInput.ItemInput />
</TagsInput.Item>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</TagsInput.Control>
</TagsInput.Root>
</template>
When the input has an empty value or the caret is at the start position, the tags can be selected by using the arrow left and arrow right keys. When “visual” focus in on any tag:
To set the initial tag values, set the defaultValue
prop.
import { TagsInput } from '@ark-ui/react'
const InitialValue = () => {
return (
<TagsInput.Root defaultValue={['React', 'Solid', 'Vue']}>
{(api) => (
<>
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
{api.value.map((value, index) => (
<TagsInput.Item key={index} index={index} value={value}>
<TagsInput.ItemInput />
<TagsInput.ItemText>{value}</TagsInput.ItemText>
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.Item>
))}
</TagsInput.Control>
<TagsInput.Input placeholder="Add tag" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</>
)}
</TagsInput.Root>
)
}
import { TagsInput } from '@ark-ui/solid'
import { Index } from 'solid-js'
const InitialValue = () => {
return (
<TagsInput.Root value={['React', 'Solid', 'Vue']}>
{(api) => (
<>
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
<Index each={api().value}>
{(value, index) => (
<TagsInput.Item index={index} value={value()}>
<TagsInput.ItemText>{value()}</TagsInput.ItemText>
<TagsInput.ItemInput />
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.Item>
)}
</Index>
</TagsInput.Control>
<TagsInput.Input placeholder="Add tag" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</>
)}
</TagsInput.Root>
)
}
<script setup lang="ts">
import { ref } from 'vue'
import { TagsInput } from '@ark-ui/vue'
const frameworks = ref(['React', 'Solid', 'Vue'])
</script>
<template>
<TagsInput.Root v-slot="api" v-model="frameworks">
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
<TagsInput.Item
v-for="(value, index) in api.value"
:key="index"
:index="index"
:value="value"
>
<TagsInput.ItemInput />
<TagsInput.ItemText>{{ value }}</TagsInput.ItemText>
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.Item>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</TagsInput.Control>
</TagsInput.Root>
</template>
To limit the number of tags within the component, you can set the max
property
to the limit you want. The default value is Infinity
.
When the tag reaches the limit, new tags cannot be added except the
allowOverflow
prop is set to true
.
import { TagsInput } from '@ark-ui/react'
const MaxWithOverflow = () => {
return (
<TagsInput.Root max={3} allowOverflow>
{(api) => (
<>
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
{api.value.map((value, index) => (
<TagsInput.Item key={index} index={index} value={value}>
<TagsInput.ItemInput />
<TagsInput.ItemText>{value}</TagsInput.ItemText>
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.Item>
))}
</TagsInput.Control>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</>
)}
</TagsInput.Root>
)
}
import { TagsInput } from '@ark-ui/solid'
import { Index } from 'solid-js'
const MaxWithOverflow = () => {
return (
<TagsInput.Root max={3} allowOverflow>
{(api) => (
<>
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
<Index each={api().value}>
{(value, index) => (
<TagsInput.Item index={index} value={value()}>
<TagsInput.ItemText>{value()}</TagsInput.ItemText>
<TagsInput.ItemInput />
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.Item>
)}
</Index>
</TagsInput.Control>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</>
)}
</TagsInput.Root>
)
}
<script setup lang="ts">
import { ref } from 'vue'
import { TagsInput } from '@ark-ui/vue'
const frameworks = ref(['React', 'Solid', 'Vue'])
</script>
<template>
<TagsInput.Root v-slot="api" :max="3" allowOverflow>
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
<TagsInput.Item
v-for="(value, index) in api.value"
:key="index"
:index="index"
:value="value"
>
<TagsInput.ItemInput />
<TagsInput.ItemText>{{ value }}</TagsInput.ItemText>
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.Item>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</TagsInput.Control>
</TagsInput.Root>
</template>
Before a tag is added, the validate
function is called to determine whether to
accept or reject a tag.
A common use-case for validating tags is preventing duplicates or validating the data type.
import { TagsInput } from '@ark-ui/react'
const Validated = () => {
return (
<TagsInput.Root
validate={(details) => {
return !details.value.includes(details.inputValue)
}}
>
{(api) => (
<>
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
{api.value.map((value, index) => (
<TagsInput.Item key={index} index={index} value={value}>
<TagsInput.ItemInput />
<TagsInput.ItemText>{value}</TagsInput.ItemText>
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.Item>
))}
</TagsInput.Control>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</>
)}
</TagsInput.Root>
)
}
import { TagsInput } from '@ark-ui/solid'
import { Index } from 'solid-js'
const Validated = () => {
return (
<TagsInput.Root
validate={(details) => {
return !details.value.includes(details.inputValue)
}}
>
{(api) => (
<>
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
<Index each={api().value}>
{(value, index) => (
<TagsInput.Item index={index} value={value()}>
<TagsInput.ItemText>{value()}</TagsInput.ItemText>
<TagsInput.ItemInput />
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.Item>
)}
</Index>
</TagsInput.Control>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</>
)}
</TagsInput.Root>
)
}
<script setup lang="ts">
import { ref } from 'vue'
import { TagsInput } from '@ark-ui/vue'
const frameworks = ref(['React', 'Solid', 'Vue'])
</script>
<template>
<TagsInput.Root
v-slot="api"
:validate="
(details) => {
return !details.value.includes(details.inputValue)
}
"
>
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
<TagsInput.Item
v-for="(value, index) in api.value"
:key="index"
:index="index"
:value="value"
>
<TagsInput.ItemInput />
<TagsInput.ItemText>{{ value }}</TagsInput.ItemText>
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.Item>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</TagsInput.Control>
</TagsInput.Root>
</template>
When the tags input is blurred, you can configure the action the component
should take by passing the blurBehavior
prop.
add
— Adds the tag to the list of tags.clear
— Clears the tags input value.import { TagsInput } from '@ark-ui/react'
const BlurBehavior = () => {
return (
<TagsInput.Root blurBehavior="add">
{(api) => (
<>
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
{api.value.map((value, index) => (
<TagsInput.Item key={index} index={index} value={value}>
<TagsInput.ItemInput />
<TagsInput.ItemText>{value}</TagsInput.ItemText>
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.Item>
))}
</TagsInput.Control>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</>
)}
</TagsInput.Root>
)
}
import { TagsInput } from '@ark-ui/solid'
import { Index } from 'solid-js'
const BlurBehavior = () => {
return (
<TagsInput.Root blurBehavior="add">
{(api) => (
<>
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
<Index each={api().value}>
{(value, index) => (
<TagsInput.Item index={index} value={value()}>
<TagsInput.ItemText>{value()}</TagsInput.ItemText>
<TagsInput.ItemInput />
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.Item>
)}
</Index>
</TagsInput.Control>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</>
)}
</TagsInput.Root>
)
}
<script setup lang="ts">
import { ref } from 'vue'
import { TagsInput } from '@ark-ui/vue'
const frameworks = ref(['React', 'Solid', 'Vue'])
</script>
<template>
<TagsInput.Root v-slot="api" blurBehavior="add">
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
<TagsInput.Item
v-for="(value, index) in api.value"
:key="index"
:index="index"
:value="value"
>
<TagsInput.ItemInput />
<TagsInput.ItemText>{{ value }}</TagsInput.ItemText>
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.Item>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</TagsInput.Control>
</TagsInput.Root>
</template>
To add a tag when a arbitrary value is pasted in the input element, pass the
addOnPaste
prop.
When a value is pasted, the component will:
validate
optiondelimiter
option passedimport { TagsInput } from '@ark-ui/react'
const PasteBehavior = () => {
return (
<TagsInput.Root addOnPaste delimiter=",">
{(api) => (
<>
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
{api.value.map((value, index) => (
<TagsInput.Item key={index} index={index} value={value}>
<TagsInput.ItemInput />
<TagsInput.ItemText>{value}</TagsInput.ItemText>
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.Item>
))}
</TagsInput.Control>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</>
)}
</TagsInput.Root>
)
}
import { TagsInput } from '@ark-ui/solid'
import { Index } from 'solid-js'
const PasteBehavior = () => {
return (
<TagsInput.Root addOnPaste delimiter=",">
{(api) => (
<>
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
<Index each={api().value}>
{(value, index) => (
<TagsInput.Item index={index} value={value()}>
<TagsInput.ItemText>{value()}</TagsInput.ItemText>
<TagsInput.ItemInput />
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.Item>
)}
</Index>
</TagsInput.Control>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</>
)}
</TagsInput.Root>
)
}
<script setup lang="ts">
import { ref } from 'vue'
import { TagsInput } from '@ark-ui/vue'
const frameworks = ref(['React', 'Solid', 'Vue'])
</script>
<template>
<TagsInput.Root v-slot="api" addOnPaste delimiter=",">
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
<TagsInput.Item
v-for="(value, index) in api.value"
:key="index"
:index="index"
:value="value"
>
<TagsInput.ItemInput />
<TagsInput.ItemText>{{ value }}</TagsInput.ItemText>
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.Item>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</TagsInput.Control>
</TagsInput.Root>
</template>
by default the tags can be edited by double-clicking on the tag or focusing on
them and pressing Enter. To disable this behavior, pass
allowEditTag={false}
import { TagsInput } from '@ark-ui/react'
const DisabledEditing = () => {
return (
<TagsInput.Root allowEditTag={false}>
{(api) => (
<>
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
{api.value.map((value, index) => (
<TagsInput.Item key={index} index={index} value={value}>
<TagsInput.ItemInput />
<TagsInput.ItemText>{value}</TagsInput.ItemText>
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.Item>
))}
</TagsInput.Control>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</>
)}
</TagsInput.Root>
)
}
import { TagsInput } from '@ark-ui/solid'
import { Index } from 'solid-js'
const DisabledEditing = () => {
return (
<TagsInput.Root allowEditTag={false}>
{(api) => (
<>
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
<Index each={api().value}>
{(value, index) => (
<TagsInput.Item index={index} value={value()}>
<TagsInput.ItemText>{value()}</TagsInput.ItemText>
<TagsInput.ItemInput />
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.Item>
)}
</Index>
</TagsInput.Control>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</>
)}
</TagsInput.Root>
)
}
<script setup lang="ts">
import { ref } from 'vue'
import { TagsInput } from '@ark-ui/vue'
const frameworks = ref(['React', 'Solid', 'Vue'])
</script>
<template>
<TagsInput.Root v-slot="api" :allowEditTag="false">
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
<TagsInput.Item
v-for="(value, index) in api.value"
:key="index"
:index="index"
:value="value"
>
<TagsInput.ItemInput />
<TagsInput.ItemText>{{ value }}</TagsInput.ItemText>
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.Item>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</TagsInput.Control>
</TagsInput.Root>
</template>
During the lifetime of the tags input interaction, here’s a list of events we emit:
onValueChange
— invoked when the tag value changes.onHighlightChange
— invoked when a tag has visual focus.onValueInvalid
— invoked when the max tag count is reached or the validate
function returns false
.import { TagsInput } from '@ark-ui/react'
const OnEvent = () => {
return (
<TagsInput.Root
onValueChange={(details) => {
console.log('tags changed to:', details.value)
}}
onHighlightChange={(details) => {
console.log('highlighted tag:', details.highlightedValue)
}}
onValueInvalid={(details) => {
console.log('Invalid!', details.reason)
}}
max={3}
allowOverflow
validate={(details) => {
return !details.value.includes(details.inputValue)
}}
>
{(api) => (
<>
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
{api.value.map((value, index) => (
<TagsInput.Item key={index} index={index} value={value}>
<TagsInput.ItemInput />
<TagsInput.ItemText>{value}</TagsInput.ItemText>
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.Item>
))}
</TagsInput.Control>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</>
)}
</TagsInput.Root>
)
}
import { TagsInput } from '@ark-ui/solid'
import { Index } from 'solid-js'
const OnEvent = () => {
return (
<TagsInput.Root
onValueChange={(details) => {
console.log('tags changed to:', details.value)
}}
onHighlightChange={(details) => {
console.log('highlighted tag:', details.highlightedValue)
}}
onValueInvalid={(details) => {
console.log('Invalid!', details.reason)
}}
max={3}
allowOverflow
validate={(details) => {
return !details.value.includes(details.inputValue)
}}
>
{(api) => (
<>
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
<Index each={api().value}>
{(value, index) => (
<TagsInput.Item index={index} value={value()}>
<TagsInput.ItemText>{value()}</TagsInput.ItemText>
<TagsInput.ItemInput />
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.Item>
)}
</Index>
</TagsInput.Control>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</>
)}
</TagsInput.Root>
)
}
<script setup lang="ts">
import { ref } from 'vue'
import { TagsInput } from '@ark-ui/vue'
const frameworks = ref(['React', 'Solid', 'Vue'])
</script>
<template>
<TagsInput.Root
v-slot="api"
@value-change="
(details) => {
console.log('tags changed to:', details.value)
}
"
@highlight-change="
(details) => {
console.log('highlighted tag:', details.highlightedValue)
}
"
@value-invalid="
(details) => {
console.log('Invalid!', details.reason)
}
"
:max="3"
allowOverflow
:validate="
(details) => {
return !details.value.includes(details.inputValue)
}
"
>
<TagsInput.Label>Frameworks</TagsInput.Label>
<TagsInput.Control>
<TagsInput.Item
v-for="(value, index) in api.value"
:key="index"
:index="index"
:value="value"
>
<TagsInput.ItemInput />
<TagsInput.ItemText>{{ value }}</TagsInput.ItemText>
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
</TagsInput.Item>
<TagsInput.Input placeholder="Add Framework" />
<TagsInput.ClearTrigger>Clear all</TagsInput.ClearTrigger>
</TagsInput.Control>
</TagsInput.Root>
</template>
index | string | number | |
value | string | |
asChild Render as a different element type. | boolean | |
disabled | boolean |
addOnPaste Whether to add a tag when you paste values into the tag input | boolean | |
allowEditTag 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. | boolean | |
allowOverflow Whether to allow tags to exceed max. In this case, we'll attach `data-invalid` to the root | boolean | |
asChild Render as a different element type. | boolean | |
autoFocus Whether the input should be auto-focused | boolean | |
blurBehavior 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 | 'clear' | 'add' | "none" |
defaultValue The initial value of the tags input. | string[] | |
delimiter 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 | string | "," (aka COMMA) |
dir The document's text/writing direction. | 'ltr' | 'rtl' | "ltr" |
disabled Whether the tags input should be disabled | boolean | |
form The associate form of the underlying input element. | string | |
getRootNode A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron. | () => Node | ShadowRoot | Document | |
id The unique identifier of the machine. | string | |
ids The ids of the elements in the tags input. Useful for composition. | Partial<{
root: string
input: string
clearBtn: string
label: string
control: string
item(opts: ItemProps): string
itemDeleteTrigger(opts: ItemProps): string
itemInput(opts: ItemProps): string
}> | |
inputValue The tag input's value | string | |
invalid Whether the tags input is invalid | boolean | |
max The max number of tags | number | |
maxLength The max length of the input. | number | |
name The name attribute for the input. Useful for form submissions | string | |
onFocusOutside Function called when the focus is moved outside the component | (event: FocusOutsideEvent) => void | |
onHighlightChange Callback fired when a tag is highlighted by pointer or keyboard navigation | (details: HighlightChangeDetails) => void | |
onInteractOutside Function called when an interaction happens outside the component | (event: InteractOutsideEvent) => void | |
onPointerDownOutside Function called when the pointer is pressed down outside the component | (event: PointerDownOutsideEvent) => void | |
onValueChange Callback fired when the tag values is updated | (details: ValueChangeDetails) => void | |
onValueInvalid Callback fired when the max tag count is reached or the `validateTag` function returns `false` | (details: ValidityChangeDetails) => void | |
readOnly Whether the tags input should be read-only | boolean | |
translations Specifies the localized strings that identifies the accessibility elements and their states | IntlTranslations | |
validate Returns a boolean that determines whether a tag can be added. Useful for preventing duplicates or invalid tag values. | (details: ValidateArgs) => boolean | |
value The tag values | string[] |
asChild Render as a different element type. | boolean |
asChild Render as a different element type. | boolean |
asChild Render as a different element type. | boolean |
asChild Render as a different element type. | boolean |
asChild Render as a different element type. | boolean |
asChild Render as a different element type. | boolean |
asChild Render as a different element type. | boolean |
asChild Render as a different element type. | boolean |