Skip to content

Santhosh1392/tags-input-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

tags-input-react

Tags Input Component

How to Install

Make sure you have Node.js and NPM installed.

npm install tags-input-react

Demo

Check demo online here.

How to Use

import React, { Component } from 'react'
import TagsInput from 'tags-input-react'

class TagsInputDemo extends Component {
  constructor() {
    super()
    this.state = {
      tags: []
    }
    this.handleOnChange = this.handleOnChange.bind(this)
  }

  handleOnChange (tags, value) {
    this.setState({
      tags
    })
  }

  render() {
    return (
      <TagsInput
        placeholder='Type here...'
        onChange={this.handleOnChange}
      />
    )
  }
}

Available PropTypes

Prop Name Type Default Value Description
tags array [] Array of tags for Pre-populate in Input
preventDuplicates Boolean true Preventing duplicates in tags
placeholder string 'Type here' Placeholder in input
onChange Function null Callback function to get the tags created by user

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published