React Color Colorful
Colorful Component is a subcomponent of @react-color
.
Install
npm i @uiw/react-color-colorful
Usage
import Colorful from '@uiw/react-color-colorful';
function Demo() {
const [hex, setHex] = useState("#fff");
return (
<Colorful
color={hex}
onChange={(color) => {
setHex(color.hex);
}}
/>
);
}
Props
import React from 'react';
import { HsvaColor, ColorResult } from '@uiw/color-convert';
export interface ColorfulProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'color'> {
prefixCls?: string;
onChange?: (color: ColorResult) => void;
color?: string | HsvaColor;
}
License
Licensed under the MIT License.