Package Exports
- react-color-palette
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-color-palette) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-color-palette
Color picker for React
Installation
npm
npm install react-color-palette
yarn
yarn add react-color-palette
Usage
import React, { useState } from "react";
import ColorPicker from "react-color-palette";
export const App = () => {
const [color, setColor] = useState("#121212");
return (
<ColorPicker
width={225}
defaultColor={color}
onChange={color => setColor(color.hex)}
/>
);
};
Props
width
The width of the color picker.
height (optional)
The height of the color picker.
defaultColor
Initial color (HEX or HTML Color Name).
onChange
A function that accepts an object of the updated color as a single argument. The object contains 3 color models: hex, rgb and hsb.
License
Code released under the MIT license.