Skip to content

TagInput ​

Input that creates tags on Enter, with support for a maximum limit, removal and duplicate prevention.

TagInput

Design lines ​

vue
vue
1<Tabs defaultValue="tuix">2  <TabsList>3    <Tab value="tuix">TUIX</Tab>4    <Tab value="rubik">Rubik</Tab>5  </TabsList>6  <TabPanel value="tuix">7    <TagInput :model-value="['vue']" design="tuix" />8  </TabPanel>9  <TabPanel value="rubik">10    <TagInput :model-value="['vue']" design="rubik" />11  </TabPanel>12</Tabs>

Demo ​

Basic (modelValue) ​

Binds the current tag list with v-model through modelValue.

vue
1<TagInput v-model="tags" color="success" :max="5" placeholder="Add tag..." />

Color (color) ​

Each row keeps its own tags: adding or removing in one never affects the others.

vue
1<script setup lang="ts">2import { ref } from 'vue'3import { TagInput } from '@dowardev/herdrate-vue'45const tagPrimary = ref<string[]>(['vue'])6const tagSuccess = ref<string[]>(['vue'])7</script>89<template>10  <TagInput v-model="tagPrimary" color="primary" placeholder="Primary" />11  <TagInput v-model="tagSuccess" color="success" placeholder="Success" />12</template>

Limit (max) ​

Caps the number of tags through the max prop (0 disables the limit).

vue
1<TagInput v-model="tagsLimited" :max="5" />

Disabled (disabled) ​

Disables the input and tag interaction through the disabled prop.

locked
vue
1<TagInput v-model="tags" disabled />

Props ​

modelValue ​

Current list of tags (v-model with string array).

TypeDefaultRequired
string[][]❌

color ​

Semantic color of the tags.

TypeDefaultRequired
'primary' | 'secondary' | 'tertiary' | 'success' | 'warning' | 'danger' | 'light' | 'medium' | 'dark''primary'❌

disabled ​

Disables the input and interaction with the tags.

TypeDefaultRequired
booleanfalse❌

placeholder ​

Placeholder of the text field.

TypeDefaultRequired
string'Add tag...'❌

max ​

Maximum number of allowed tags (0 = no limit).

TypeDefaultRequired
number0❌

design ​

Design line (or inherit from data-design).

TypeDefaultRequired
'tuix' | 'rubik'— (inherits from data-design)❌

Events ​

EventPayloadDescription
update:modelValuestring[]Emitted when a tag is added or removed

CSS Custom Properties ​

TokenDefaultDescription
--font-mono"JetBrains Mono", ui-monospace, monospaceMonospace font stack for code-like content (key labels, log lines, chips).
--accentfrom theme (--ctp-latte-mauve / --ctp-mocha-mauve)Accent color, mapped from the active semantic color.
--bgfrom theme (--ctp-latte-base / --ctp-mocha-base)Base background of the surface.
--borderfrom theme (--ctp-latte-surface0 / --ctp-mocha-surface0)Outline and divider color for surfaces.
--textfrom theme (--ctp-latte-text / --ctp-mocha-text)Primary text color used inside the component.
--cp-easecubic-bezier(.4, 0, .2, 1)Default easing curve for transitions.

Ver Theming para la convención completa.