1.0.5 • Published 2 years ago
custom-react-tags v1.0.5
custom-tags
Tags input library for react
Install
npm i custom-react-tags
Usage
import React, { Component } from 'react'
import CustomTags from 'custom-react-tags'
import 'custom-react-tags/dist/index.css'
class Example extends Component {
render() {
return <CustomTags />
}
}
Props | Example | Type | Details |
---|---|---|---|
addNewText | addNewText="+ Add New Tag" | string | For showing the add new button text |
initialValue | initialValue={[{label: "Firstone", editable: false, remove: false}, { label: "Test 2", remove: true, editable: true }]} | array | For setting initial value. You can pass the remove: true/false for individual tags if you want to allow remove or not a specific tag. Use the editable: true/false to make each tag editable or not. New tags added are always editable, this is only for initialvalue. |
closeColor | closeColor="white" | string | For close icon color |
closeBGColor | closeBGColor="red" | string | For the background color of the close icon |
tagTextColor | tagTextColor="darkred" | string | For setting text color of each tag |
tagTextColor | tagTextColor="darkred" | string | For setting text color of each tag |
tagColor | tagColor="pink" | string | For setting the background color of a tag |
addBtnColor | addBtnColor="red" | string | For setting the color of the add button text |
onChange | onChange={(data) => { }} | function | For getting the updated values of the tags |
License
MIT © kashyap-sith