1.0.2 • Published 10 months ago

react-custom-color-picker v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

Color Picker

This color picker developed for react lets you choose from a number of predefined colors.

Quick Start with React

Install:

npm i react-custom-color-picker

Simple usage:

import ColorPicker from 'react-custom-color-picker'

const MyComponent = () => {
  const [color, setColor] = useState('#fff')

  return <ColorPicker onChange={c => setColor(c)} colorList={['#fff', '#000']} />
}

Basic Usage

This component can take three parameters :

  • onChange : function that handles color change.
  • colorList : optional - The list of colors suggested by the color picker. ([] default)
  • styleSize : optional - Number corresponding to the font size used for the style. (16 default)

Example :

import ColorPicker from 'react-custom-color-picker'

const MyComponent = () => {
  const [color, setColor] = useState('#fff')

  return <ColorPicker onChange={setColor} colorList={['#fff', '#000']} styleSize={20} />
}
1.0.2

10 months ago

1.0.1

10 months ago

0.0.1

10 months ago