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, }, classNames: { type: Object as PropType<{ container: string; name: string; closeButton: string; }>, default: () => ({}), }, // 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:
Changelog:
v0.4.1 (02/13/2022)
- Bugfixes
v0.4.0 (02/09/2022)
- New classNames prop for customizing different elements within the component
v0.3.2 (08/31/2022)
- Tag delete – Better form support
v0.3.1 (07/17/2022)
- lib updates and fixes
v0.3.0 (11/22/2021)
- Updated all dependencies
- Some minor refactoring
- Fixed bugs
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