1.0.6 • Published 3 years ago

taginput-react v1.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

taginput-react

Tags input component in react.

How to Install

Make sure you have Node.js and NPM installed.

npm install taginput-react

Or

yarn add taginput-react

How to Use

import React, { useState } from 'react'
import TagsInput from 'taginput-react'

const TagsInputDemo = () => {
  const [tags, setTags] = useState([])
  const handleOnChange = (data) => {
    setTags(data)
  }

  return (
    <TagsInput
      onChange={handleOnChange}
      placeholder="Enter to add"
    />
  )
}

Demo

Tag Input Demo

Check out Online Demo here.

Available Props

Prop NameTypeDefault ValueDescription
tagsarray[]Initial Tags
placeholderString'Enter to add'Input placeholder
onChangeFunctionnullCallback function to get the entered Tags by user
tagClassNameString''Used to style tag element