Package Exports
- react-gcolor-picker
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-gcolor-picker) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
React gradient color picker
Inspired by gpickr
Install
Important: this component uses React Hooks and works on React version 16.8.0 and higher
npm install --save react-gcolor-picker
Usage
import React from 'react';
import ReactGPicker from 'react-gcolor-picker';
function App() {
const onChange = (value) => {
console.log(value);
};
return <ReactGPicker value='red' onChange={onChange} />;
}
export default App;
Props
Attribute | Type | Default | Description |
---|---|---|---|
value | string |
#ffffff |
Default color value. Accepted: rgba/rgb, hsla, named colors |
gradient | bool |
false |
Show gradient color panel |
solid | bool |
true |
Show solid color panel |
debounceMS | number |
300 |
Debounce ms value |
debounce | bool |
true |
Debouce off/on |
showAlpha | bool |
true |
Show/hide alpha input and range |
popupWidth | number |
267 |
Popup width |
colorBoardHeight | number |
120 |
Board color height |
onChange | function |
null |
Default onChange function returns string value on rgba format |
License
MIT © undind