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