tags-input
Tags Input
An underlined field that collects several short values as removable tags, such as materials or interests; joins a Field around it.
States: Default, Focus, Invalid
Parts
| Part | File | Does |
|---|---|---|
| TagsInput | TagsInput.vue | Groups all parts of the tags input, where the user enters several short values. |
| TagsInputInput | TagsInputInput.vue | Lets the user type a new tag and add it to the tags input. |
| TagsInputItem | TagsInputItem.vue | Groups the text and delete button of one tag. |
| TagsInputItemDelete | TagsInputItemDelete.vue | Lets the user remove its tag. |
| TagsInputItemText | TagsInputItemText.vue | Shows the value of one tag. |
Anatomy
<TagsInput>
<TagsInputItem>
<TagsInputItemText />
<TagsInputItemDelete />
</TagsInputItem>
<TagsInputInput />
</TagsInput>Styling
| Part | Recipe |
|---|---|
| TagsInput | tags-input |
| TagsInputInput | tags-input-input |
| TagsInputItem | tags-input-item |
| TagsInputItemDelete | tags-input-item-delete |
| TagsInputItemText | tags-input-item-text |
Install
Writes 6 files into components/ui/tags-input/. For agents, npx @frontic/ui docs tags-input prints this reference as markdown; the MCP server serves the same.
- Installs with it
- use-field-control
- npm packages
- @lucide/vue
- @vueuse/core
- reka-ui
API reference
TagsInput TagsInput.vue
Groups all parts of the tags input, where the user enters several short values.
| Prop | Type | Default | |
|---|---|---|---|
| modelValue | AcceptableInputValue[] | null | — | |
| defaultValue | AcceptableInputValue[] | — | |
| addOnPaste | boolean | false | |
| addOnTab | boolean | false | |
| addOnBlur | boolean | false | |
| duplicate | boolean | false | |
| disabled | boolean | false | |
| delimiter | string | RegExp | ',' | |
| dir | Direction | — | |
| max | number | 0 | |
| id | string | — | |
| convertValue | ((value: string) => AcceptableInputValue) | — | |
| displayValue | ((value: AcceptableInputValue) => string) | — | |
| asChild | boolean | false | |
| as | AsTag | Component | — | |
| name | string | — | |
| required | boolean | false | |
| class | ClassValue | — | |
| Event | Payload | |
|---|---|---|
| update:modelValue | payload: AcceptableInputValue[] | |
| invalid | payload: AcceptableInputValue | |
| addTag | payload: AcceptableInputValue | |
| removeTag | payload: AcceptableInputValue | |
| Slot | Slot props | |
|---|---|---|
| default | { modelValue: AcceptableInputValue[]; } | |
TagsInputInput TagsInputInput.vue
TagsInputItem TagsInputItem.vue
TagsInputItemDelete TagsInputItemDelete.vue
TagsInputItemText TagsInputItemText.vue
Example