1.0.7 • Published 3 years ago

react-colored-tags v1.0.7

Weekly downloads
10
License
MIT
Repository
github
Last release
3 years ago

react-colored-tags

UI to create colored tags

NPM JavaScript Style Guide

Install

npm install --save react-colored-tags

Usage

import React, { useState } from 'react'

import ColorTags from 'react-colored-tags'

const App = () => {
  const [tags, setTags] = useState([
    {
      name: 'Tag 1',
      color: 'custom_color_1'
    },
    {
      name: 'Tag 2',
      color: 'orange'
    },
    {
      name: 'Tag 3',
      color: 'custom_color_2'
    }
  ])
  
  return (
    <ColorTags
      tags={tags}
      onChange={(tags) => setTags(tags)}
      onTagRemove={(tag) => { console.log('Removed Tag:', tag) }}
      onTagChange={(tag) => { console.log('Changed Tag:', tag) }}
      onTagCreate={(tag) => { console.log('Created Tag:', tag) }}
      customColors={
        [
          {
            name: 'custom_color_1',
            color: 'rgb(87 196 218)'
          },
          {
            name: 'custom_color_2',
            color: 'rgb(85 109 251)'
          }
        ]
      }
      styles={{
        container: {
          maxWidth: '500px',
          display: 'inline-block'
        },
        tag: {},
        colorDegustation: {},
        input: {}
      }}
    />
  )
}

export default App

License

MIT © AmirjanyanIT

1.0.7

3 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.8.0

4 years ago

0.7.0

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago