The ColorPicker Component will be used to open an eye dropper tool
, and allow user to pick the color
from the screen.
A minimal Demo Link
Value | Used as a | Description |
---|---|---|
ColorPicker | ✅ Component | Can be used as Component |
colorPicker | ✅ Service | Can be used as Service |
// Default import will return ColorPicker Component
import ColorPicker from 'fe-pilot/ColorPicker';
<ColorPicker /> // Used as a Component
import { ColorPicker, colorPicker } from 'fe-pilot/ColorPicker';
<ColorPicker /> // Used as a Component
colorPicker(); // Used as a Service
import { ColorPicker } from 'fe-pilot/ColorPicker';
const successCb = (response) => {
console.log("success response:", response);
}
const failureCb = (response) => {
console.log("failure response:", response);
}
return (
<ColorPicker successCb={successCb} failureCb={failureCb}>
Pass clickable element (button, anchor, string, icon etc)
</ColorPicker>
);
Props | Type | Description | Response |
---|---|---|---|
successCb | Function | It will be called on success |
{ data: "Can be array/object/string/number", msgType: "SUCCESSFUL", msg: "A success msg", status: "SUCCESS" } |
loadingCb | Function | It will be called before success/failure. |
{ msgType: "LOADING", msg: "LOADING...", status: "LOADING" } |
failureCb | Function | It will be called on failure |
{ msgType: "ERROR", msg: "A failed msg", status: "FAILURE" } |
Props | Type | Description | Default Values |
showForever | Boolean | To hide/remove unsupported feature, make it false. | Default value is true. |