Tag-input - A versetile tag input component built with Vue 3 Composition API

Related tags

Validation tag-input
Overview

TagInput

tag-input.gif

A versetile tag input component built with Vue 3 Composition API.

Please read this article to learn how to build this package step by step and the background story.

To learn vue js please check out our courses Vue.js Complete Course + Guide and Vue 3 Essentials

Follow us on FaceBook to get the latest discount coupons and update to our articles and packages.

To keep it thin and performant we have chosen to provide only the minified version. Because, that's what you really need. In case you are looking for the full version build your own from this source code as per Build section.

live demo

Install

npm

npm i @mayank1513/vue-tag-input --production

or

pnpm i @mayank1513/vue-tag-input --production

or

yarn add @mayank1513/vue-tag-input --production

Add dependency in package.json

    "@mayank1513/vue-tag-input": "^0.0.3"

cdn

    <script src="https://unpkg.com/[email protected]"></script>
    <script src="https://unpkg.com/@mayank1513/tag-input"></script>
    <link rel="stylesheet" href="https://unpkg.com/@mayank1513/[email protected]/dist/TagInput.css">

Usage

npm

<template>
    ...
    <tag-input v-model="tags" />
    ...
</template>

<script>
import TagInput from '@mayank1513/tag-input'
import '@mayank1513/tag-input/dist/TagInput.css'
...

export default {
  name: 'App',
  data() {
    return {
      tags: [],
      ...
    };
  },
  components: {
    TagInput,
    ...
  },
  ...
}
</script>

cdn

basic usage

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/[email protected]"></script>
    <script src="https://unpkg.com/@mayank1513/tag-input"></script>
    <link rel="stylesheet" href="https://unpkg.com/@mayank1513/[email protected]/dist/TagInput.css">
</head>

<body>
    <div id="app">
        <tag-input></tag-input>
    </div>
</body>
<script>
    Vue.createApp({
        components: {
            TagInput
        }
    }).mount('#app')
</script>

</html>

advanced usage

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/[email protected]"></script>
    <script src="https://unpkg.com/@mayank1513/vue-tag-input"></script>
    <link rel="stylesheet" href="https://unpkg.com/@mayank1513/[email protected]/dist/TagInput.css">
    <style>
        #app {
            font-family: Avenir, Helvetica, Arial, sans-serif;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-align: center;
            color: #2c3e50;
            margin-top: 60px;
            max-width: 1400px;
            margin: auto;
        }
        
        .main {
            text-align: start;
        }
    </style>
</head>

<body>
    <div id="app">
        <img class="logo" alt="Krishna Apps logo" src="https://raw.githubusercontent.com/mayank1513/tag-input/master/src/assets/logo.png" />
        <br />
        <h2>Presents</h2>
        <h1>Vue Tag Input</h1>
        <hr />
        <div class="main">
            <h1>Default options</h1>
            <tag-input v-model="tags" />
            <br />
            <span>Use <code>enter</code> key or <code>tab</code> key to create a new tag.</span>
            <h1>With custom delimiter and colors</h1>
            <tag-input tagBgColor="lightgreen" tagTextColor="darkgreen" :customDelimiter="customDelimiter" v-model="tags" />
            <br>
            <span>Use <code>enter</code> key or <code>tab</code> key or any of the custom delimeters to create a new
                tag.</span>
            <p>Custom delimiters: <code v-for="delim in customDelimiter" :key="delim"> "{{delim}}"</code></p>
            <br>
            <h1>Do not allow custom tags</h1>
            <tag-input :options="options" :allowCustom="false" tagBgColor="blue" tagTextColor="lightblue" :customDelimiter="customDelimiter" v-model="tags" />
            <br> Try entering tag that is not in options and hit <code>enter</code>
            <br>
            <span>Use <code>enter</code> key or <code>tab</code> key or any of the custom delimeters to create a new
                tag.</span>
            <p>Allowed Tags: <code v-for="tag in options" :key="tag"> "{{tag}}"</code></p>
            <p>Custom delimiters: <code v-for="delim in customDelimiter" :key="delim"> "{{delim}}"</code></p>
            <br>
            <h1>Provide options for autofill but also allow custom tags</h1>
            <tag-input :options="options" tagBgColor="blue" tagTextColor="lightblue" :customDelimiter="customDelimiter" v-model="tags" />
            <br>
            <span>Use <code>enter</code> key or <code>tab</code> key or any of the custom delimeters to create a new
                tag.</span>
            <p>Allowed Tags: <code v-for="tag in options" :key="tag"> "{{tag}}"</code></p>
            <p>Custom delimiters: <code v-for="delim in customDelimiter" :key="delim"> "{{delim}}"</code></p>
            <br>
        </div>
    </div>

    <script>
        Vue.createApp({
            data() {
                return {
                    tags: [],
                    customDelimiter: [',', ' '],
                    options: ['vue', 'composition', 'js', 'mytag1', 'mayank1513']
                };
            },
            components: {
                TagInput
            }
        }).mount('#app')
    </script>
</body>

</html>

Build

To build the example clone the repo git clone https://github.com/mayank1513/tag-input.git and run

npm i && npm run build
// or
pnpm i && npm run build 

Help us to help you more

Contribute for a Cause

You might also like...

Create coupled parent-child component pairs with composition API.

vue-coupled Background See discussion here. This package serves as a POC that: Allows any level of component encapsulation for child components. Suppo

Jul 1, 2022

基于vue3.0-ts-Element集成的简洁/实用后台模板!《带预览地址》vue-admin;vue+admin;vue-element;vue+element;vue后台管理;vue3.0-admin;vue3.0-element。

基于vue3.0-ts-Element集成的简洁/实用后台模板!《带预览地址》vue-admin;vue+admin;vue-element;vue+element;vue后台管理;vue3.0-admin;vue3.0-element。

一、基于vue3.0+ts+Element通用后台admin模板 二、在线预览地址:http://admin.yknba.cn/ 三、下载使用: 1、克隆代码 通过git将代码克隆到本地;或者使用下载安装包模式进行下载。 2、进入目录 进入项目的根目录:vue3.0-ts-admin 3、安装依

Dec 16, 2022

Vue-input-validator - 🛡️ Highly extensible & customizable input validator for Vue 2

Vue-input-validator - 🛡️ Highly extensible & customizable input validator for Vue 2

🛡️ Vue-input-validator demo! What is this package all about? By using this package, you can create input validators only with the help of a single di

May 26, 2022

Composition API & Yup Powered Form Validation

vue-yup-form Composition API & Yup Powered Form Validation. This tiny library allows Vue and Yup to be a best friend. Requirements The following versi

Dec 26, 2022

Nutrition tracking software that uses machine learning to help you reach your body composition goals.

Nutrition tracking software that uses machine learning to help you reach your body composition goals.

LogSmarter - Machine Learning Nutrition Tracker Description LogSmarter LogSmarter™ is not just another calorie counter. It is an AI nutrition coach th

Sep 4, 2022

A jQuery UI plugin to handle multi-tag fields as well as tag suggestions/autocomplete.

A jQuery UI plugin to handle multi-tag fields as well as tag suggestions/autocomplete.

Tag-it: a jQuery UI plugin Tag-it is a simple and configurable tag editing widget with autocomplete support. Homepage Demo Check the examples.html for

Dec 20, 2022

🔖 lightweight, efficient Tags input component in Vanilla JS / React / Angular / Vue

🔖 lightweight, efficient Tags input component in Vanilla JS / React / Angular / Vue

Tagify - tags input component Transforms an input field or a textarea into a Tags component, in an easy, customizable way, with great performance and

Jan 2, 2023

A phone input component that uses intl-tel-input for Laravel Filament

A phone input component that uses intl-tel-input for Laravel Filament

Filament Phone Input This package provides a phone input component for Laravel Filament. It uses International Telephone Input to provide a dropdown o

Nov 29, 2022

Magically convert a simple text input into a cool tag list with this jQuery plugin.

jQuery Tags Input Plugin Do you use tags to organize content on your site? This plugin will turn your boring tag list into a magical input that turns

Dec 23, 2022

A multi-tag input for sanity studio.

A multi-tag input for sanity studio.

sanity-plugin-tags A multi-tag input for sanity studio. Fully featured with autocomplete capabilities, live updates, predefined tag options, style and

Jul 22, 2022

Simple tag input for Bootstrap

Tagin Simple tag input for Bootstrap. Supports bootstrap v4 and v5. Demo: https://tagin.netlify.app/ Features Custom separators Enable/disable duplica

Sep 28, 2022

:tada: A magical vue admin https://panjiachen.github.io/vue-element-admin

:tada: A magical vue admin                                                                https://panjiachen.github.io/vue-element-admin

English | 简体中文 | 日本語 | Spanish SPONSORED BY 活动服务销售平台 客户消息直达工作群 Introduction vue-element-admin is a production-ready front-end solution for admin inter

Dec 31, 2022

:eyes: Vue in React, React in Vue. Seamless integration of the two. :dancers:

vuera NOTE: This project is looking for a maintainer! Use Vue components in your React app: import React from 'react' import MyVueComponent from './My

Dec 30, 2022

🎉 基于 vite 2.0 + vue 3.0 + vue-router 4.0 + vuex 4.0 + element-plus 的后台管理系统vue3-element-admin

vue3-element-admin 🎉 基于 Vite 2.0 + Vue3.0 + Vue-Router 4.0 + Vuex 4.0 + element-plus 的后台管理系统 简介 vue3-element-admin 是一个后台前端解决方案,它基于 vue3 和 element-plu

Nov 28, 2022

Jenesius vue modal is simple library for Vue 3 only

Jenesius Vue Modal Jenesius vue modal is simple library for Vue 3 only . Site Documentation Installation npm i jenesius-vue-modal For add modals in yo

Dec 30, 2022

A template repository / quick start to build Azure Static Web Apps with a Node.js function. It uses Vue.js v3, Vue Router, Vuex, and Vite.js.

A template repository / quick start to build Azure Static Web Apps with a Node.js function. It uses Vue.js v3, Vue Router, Vuex, and Vite.js.

Azure Static Web App Template with Node.js API This is a template repository for creating Azure Static Web Apps that comes pre-configured with: Vue.js

Jun 25, 2022

Vue-crypto-dashboard - Cryptocurrency Dashboard made with Vue

Vue-crypto-dashboard - Cryptocurrency Dashboard made with Vue

Vue Crypto Dashboard A Cryptocurrency Dashboard build with Vue JS, PWA enabled, Binance Websocket API for realtime price, amChart for displaying histo

Dec 14, 2022

Mosha-vue-toastify - A light weight and fun Vue 3 toast or notification or snack bar or however you wanna call it library.

Mosha-vue-toastify - A light weight and fun Vue 3 toast or notification or snack bar or however you wanna call it library.

Mosha Vue Toastify A lightweight and fun Vue 3 toast or notification or snack bar or however you wanna call it library. English | 简体中文 Talk is cheap,

Jan 2, 2023

Vue-hero-icons - A set of free MIT-licensed high-quality SVG icons, sourced from @tailwindlabs/heroicons, as Vue 2 functional components.

vue-hero-icons For Vue3, install the official package @heroicons/vue A set of free MIT-licensed high-quality SVG icons, sourced from @tailwindlabs/her

Dec 16, 2022
Releases(v0.0.3)
Owner
Mayank
Passionate Developer and Researcher. Coming from academic and research background, and actively involved in designing simulation tools and app development.
Mayank
The Vue form assembly tool that won't break your heart 💔

Loveform The Vue form assembly tool that won't break your heart ?? Loveform is a tool that helps you build validated forms in Vue 3 without the need t

Daniel Leal 16 Jun 10, 2022
[DISCONTINUED] jQuery plugin that makes it easy to validate user input while keeping your HTML markup clean from javascript code.

jQuery Form Validator [DISCONTINUED] Validation framework that let's you configure, rather than code, your validation logic. I started writing this pl

Victor Jonsson 976 Dec 30, 2022
Enable browser autofill for any input field.

Autofill It Enable browser autofill for any input field. Get it on Chrome Web Store! A Google Chrome extension that sets autocomplete attributes of an

ygkn 5 Dec 15, 2022
🪄 Multi step forms with in built validations

react-wizardry is a data-driven smart wizard component for creating powerful forms with in built validations. Demo Features ⚡ Data driven API ✅ In bui

Prabhu Murthy 38 Aug 16, 2022
Schema-Inspector is an JSON API sanitisation and validation module.

Schema-Inspector is a powerful tool to sanitize and validate JS objects. It's designed to work both client-side and server-side and to be scalable wit

null 494 Oct 3, 2022
Email capture page using Notion API

Notion Capture This starter shows how to use the new Notion API with Next.js. You can capture emails that will populate a Notion database. Live Demo •

Bilal 61 Dec 25, 2022
DiscordEmailVerifier - Quickly verify emails on your tokens for completely free using mail.tm's api.

DiscordEmailVerifier Quickly verify emails on your tokens for completely free using mail.tm's api. /* ❗ No, this code doesn't verify the email for you

eric 3 Jun 7, 2022
Reading emails from Gmail provider using Node.js along with Google API

?? Project summary Reading emails from Gmail provider using Node.js along with Google API (study only). ?? Technologies Project was built using Node.j

Jhony Walker 2 Jan 8, 2022
Creating a Blog API, with full CRUD using NodeJS, Express, Mongoose, and MongoDB.

Blog API Blog API that uses CRUD to create, login users, delete and update blog posts. https://blog-api12.herokuapp.com/ Installation Make a new folde

Eros Nolasco Mendoza 18 Jun 29, 2022