Tag Input Library
Simple library for managing tags. Written in vanilla JS without any library dependencies
Installation
Install Tag Input JS using yarn
:
yarn add tag-input-js
Or via npm
:
npm install --save tag-input-js
Or include CDN link in HTML page:
<script src="https://unpkg.com/tag-input-js@version/dist/index.js" type="text/javascript"></script>
Usage
import TagInputControl from 'tag-input-js'; const tagInstance = elementId | HTMLElement options
Parameters
elementId
string
This is ID of HTML element that will host Tag Input Control
HTMLElement
HTMLElement
This is element instance of HTML element that will host Tag Input Control
options
Object
| optional
cssClass : tagPanel: 'tagi__panel' // class name of tag panel tagElement: 'tagi__element' // class name of each tag inputElement: 'tagi__input' // class name of input control {} // return custom remove button initialTags: // list of tags will be shown on initial time {} // callback function will be execute everytime tag list changes
Example
Tag Input - Example
Contribute
That will be great if you pull requests and help the code better
Build
npm run build
Tests
npm run startnpm run test
License
MIT