Smart Tags Input Component For Vue.js 3 – smart-tagz

Description:

A full-featured and well designed tags input component for Vue.js 3 powered app.

More Features:

  • Editable tags.
  • Prevents duplicate tags.
  • Autocomplete integrated.
  • Custom color scheme.

How to use it:

1. Import the smart-tagz component.

import { defineComponent } from "vue";
import { SmartTagz } from "smart-tagz";
import "smart-tagz/dist/smart-tagz.css";
export default defineComponent({
  name: "Basic",
  components: {
    SmartTagz,
  }
});

2. Add the component to the app template.

<smart-tagz />

3. Customize the tags input with the following props.

// is readonly
readOnly: {
  type: Boolean,
  default: false,
},
// default Tags
defaultTags: {
  type: Array as PropType<string[]>,
  default: () => [],
},
// container width
width: {
  type: String,
  default: "100%",
},
// sources array for autosuggest
sources: {
  type: Array as PropType<string[]>,
  default: () => [],
},
// switch to enable autosuggest
autosuggest: {
  type: Boolean,
  default: false,
},
// prop to enbale text paste
allowPaste: {
  type: Object as PropType<{ delimiter: string }>,
  default: null,
},
// makes the tag editable
editable: {
  type: Boolean,
  default: false,
},
// prop to control duplicates in the list
allowDuplicates: {
  type: Boolean,
  default: true,
},
// maximum number of tags allowed
maxTags: {
  type: Number,
  default: 20,
},
// placeholder for the input box
inputPlaceholder: {
  type: String,
  default: "Enter tag...",
},
quickDelete: {
  type: Boolean,
  default: false
},
// custom styles here
theme: {
  type: Object as PropType<{
    primary: string;
    secondary: string;
    tagTextColor: string;
  }>,
  default: () => ({
    primary: "#6093ca",
    background: "#eaf1f8",
    tagTextColor: "#fff",
  }),
},

Preview:

Smart Tags Input Component For Vue.js 3 - smart-tagz

Changelog:

v0.1.12 (01/06/2021)

  • Update

Download Details:

Author: prabhuignoto

Live Demo: https://smart-tagz.vercel.app/

Download Link: https://github.com/prabhuignoto/smart-tagz/archive/master.zip

Official Website: https://github.com/prabhuignoto/smart-tagz

Install & Download:

# Yarn
$ yarn add smart-tagz --save

# NPM
$ npm i smart-tagz --save

You Might Be Interested In:

Add Comment