react-predefined-color-picker
v0.1.14
Published
A tiny color predefined picker component for React and Preact apps
Downloads
36
Maintainers
Readme
react-predefined-color-picker
:construction: Under development :construction:
A tiny color predefined picker component for React and Preact apps
Install
npm install --save react-predefined-color-picker
Usage
import React, { Component } from 'react'
import ColorPredefinedPicker from 'react-predefined-color-picker'
function Example() {
function handleColorChange(color) {
console.log(color)
}
return(
<ColorPredefinedPicker onChange={(color) => handleColorChange(color)} />
)
}
Props
| Prop | Type | Required | Default | Note |
| ---------------------- | ------------------- | -------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| onChange | EventHandler | Yes | | Event Handler
| colors | Array of string | No | | Array of strings containing colors. Eg: ["red", "blue", "#2668CA", "rgb(30, 40, 50)"]
| size | string | No | medium | Size. Possible options are: small
, medium
, large
| columns | number | No | 3 | Number of columns
License
MIT © israelpossoli