npm.io
2.0.0 • Published 4 years ago

color-picker-menu

Licence
MIT
Version
2.0.0
Deps
3
Size
58 kB
Vulns
0
Weekly
0
Stars
6

Color Picker Menu

Image

Demo

Live Demo

Installation & Usage

npm install color-picker-menu --save

OR

yarn add color-picker-menu
Include the Component
import React from 'react';
import { ColorPickerMenu } from 'color-picker-menu';

const Component = () => {
  return <ColorPickerMenu />;
};
Properties
  • None of the properties are required
  • Any color passed should be in HEX format
Property Description Default Type
ref reference of the button which opens the color picker menu. The position of the menu is based on this reference.
theme light or dark light string
colors array
selected string
removeColor transparent or any color string
enableAddNew true boolean
defaultFormat hex, rgb, or hsl hex string
allowedFormats ['hex', 'rgb', 'hsl'] array
itemsPerRow 6 number
onChange when color is changed via click or SAVE button. It returns an object with hex, rgb and hsl values. func
onHide when the detected click is outside the color picker func

Keywords