react-color-palette-picker
Version:
React Color Picker Component written in typescript.
49 lines (48 loc) • 1.5 kB
TypeScript
import { ColorConverter } from '@wilfredlopez/color-converter';
export interface ColorPickerProps {
/**
* The width of the color picker.
*/
width?: number;
/**
* The height of the color picker.
*/
height?: number;
/**
* Color in the `ColorConverter` or color string.
* @type { ColorConverter } ColorConverter `https://www.npmjs.com/package/@wilfredlopez/color-converter`
*/
color?: string | ColorConverter;
/**
* The function that accepts the updated `color` and a `colorConverter` as arguments.
* @ColorConverter `https://www.npmjs.com/package/@wilfredlopez/color-converter`
*/
onChange?: (color: string, convertedColor: ColorConverter) => void;
/**
* classNames to override the defaults
*/
pickerClasses?: ColorPickerClasses;
/**
* Show or hide the hex and rgb inputs.
*/
hideControls?: boolean;
}
export interface ColorPickerClasses {
container?: string;
controlsContainer?: string;
saturation?: {
container?: string;
saturationCursor?: string;
canvas?: string;
};
hueBar?: {
container?: string;
cursorClass?: string;
};
fields?: {
container?: string;
inputs?: string;
};
}
declare const ReactColorPicker: ({ width, height, color, onChange, hideControls, pickerClasses }: ColorPickerProps) => JSX.Element;
export default ReactColorPicker;