Used to enter multiple values as tags.
import { useState } from 'react';
import { TagInput } from '@fintech-sandpit/ui/react';
const [value, setValue] = useState<string[]>([]);
import { ref } from 'vue';
import { TagInput } from '@fintech-sandpit/ui/vue';
const value = ref<string[]>([]);
| Name | Type | Default | Description |
|---|
value | string[] | — | The value of the tag input |
defaultValue | string[] | — | The default value of the tag input |
name | string | — | The name of the tag input |
size | Size | md | The size of the tag input |
maxLength | number | — | The maximum length of the tag input |
blurBehavior | BlurBehavior | blur | The blur behavior of the tag input |
placeholder | string | — | Placeholder of the tag input |
required | boolean | false | Whether the tag input is required |
invalid | boolean | false | Whether the tag input is invalid |
read-only | boolean | false | Whether the tag input is read only |
disabled | boolean | false | Whether the tag input is disabled |
validate | (args: TagInputValidateArgs) => boolean | — | The validation function of the tag input |
| Name | Type | Default | Description |
|---|
model-value | string[] | — | The value of the tag input 1 |
default-value | string[] | — | The default value of the tag input |
name | string | — | The name of the tag input |
label | string | — | The label of the tag input |
size | Size | md | The size of the tag input |
max-length | number | — | The maximum length of the tag input |
blur-behavior | BlurBehavior | blur | The blur behavior of the tag input |
placeholder | string | — | The placeholder of the tag input |
required | boolean | false | Whether the tag input is required |
invalid | boolean | false | Whether the tag input is invalid |
read-only | boolean | false | Whether the tag input is read only |
validate | (args: TagInputValidateArgs) => boolean | — | The validation function of the tag input |
- Can be used with the
v-model directive for two-way binding.
| Name | Arguments | Description |
|---|
onChange | (value: string[]) => void | Callback fired when the value changes |
| Name | Payload | Description |
|---|
update:model-value | string[] | Event emitted when the value changes |
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
type TagInputValidateArgs = {
The behavior of the tags input when the input is blurred.
type BlurBehavior = 'add' | 'clear'
| Value | Description |
|---|
add | Add the input value as a new tag |
clear | Clear the input value |