Skip to content

FormTags

Multi-value chip input built on Reka UI's TagsInput primitive. Type a value and press the delimiter (default ,) or Enter to commit it as a chip; backspace from an empty input removes the trailing chip; click × on a chip to delete it.

Common use cases: tag pickers, email recipient lists, comma-separated keyword inputs.

bash
npm install @vuecs/forms

Basic usage

vue
<script setup lang="ts">
import { VCFormTags } from '@vuecs/forms';
import { ref } from 'vue';

const tags = ref<string[]>(['vue', 'reka', 'tailwind']);
</script>

<template>
    <VCFormTags v-model="tags" placeholder="Add a tag…" add-on-paste />
</template>
css
@import "tailwindcss";
@import "@vuecs/design";

@import "@vuecs/forms";

@custom-variant dark (&:where(.dark, .dark *));

Props

PropTypeDefaultDescription
modelValuestring[] | number[] | nullundefinedBound value array
placeholderstringundefinedInput placeholder when empty
disabledbooleanfalseDisable interaction
requiredbooleanfalseForm-required attribute
maxnumberundefinedMax number of tags allowed
addOnPastebooleanfalseSplit pasted strings on delimiter and add each as a tag
addOnTabbooleanfalseCommit the current input as a tag on Tab
addOnBlurbooleantrueCommit on input blur
duplicatebooleanfalseAllow duplicate tags
delimiterstring | RegExp','Character (or regex) that triggers tag commit
namestringundefinedForm-submission name
idstringundefinedRoot id
themeClassPartial<FormTagsThemeClasses>undefinedPer-instance theme override
themeVariantRecord<string, string | boolean>undefinedPer-instance variant values

Events

EventPayloadDescription
update:modelValuestring[] | number[]Emitted whenever the tag list changes
invalidstringEmitted when a tag is rejected (e.g. duplicate, max exceeded)

Released under the Apache 2.0 License.