Skip to content

Latest commit

 

History

History
152 lines (132 loc) · 2.64 KB

README.md

File metadata and controls

152 lines (132 loc) · 2.64 KB

ColorPicker

The ColorPicker Component will be used to open an eye dropper tool, and allow user to pick the color from the screen.

Demo

A minimal Demo Link

Usage/Examples

Value Used as a Description
ColorPicker ✅ Component Can be used as Component
colorPicker ✅ Service Can be used as Service
1. Here's an example of basic usage with Default Import:
// Default import will return ColorPicker Component
import ColorPicker from 'fe-pilot/ColorPicker';

<ColorPicker /> // Used as a Component
2. Here's an example of basic usage with Multiple Import:
import { ColorPicker, colorPicker } from 'fe-pilot/ColorPicker';

<ColorPicker /> // Used as a Component

colorPicker(); // Used as a Service
3. Here's an example of a advanced usage:
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

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.