React Color Swatch
Circle Component is a subcomponent of @react-color
.
Install
npm i @uiw/react-color-circle
Usage
import Circle from '@uiw/react-color-circle';
function Demo() {
const [hex, setHex] = useState('#F44E3B');
return (
<Circle
colors={[ '#F44E3B', '#FE9200', '#FCDC00', '#DBDF00' ]}
color={hex}
onChange={(color) => {
setHex(color.hex);
}}
/>
);
}
Props
import { SwatchProps } from '@uiw/react-color-swatch';
import { ColorResult, HsvaColor } from '@uiw/color-convert';
interface CircleProps extends Omit<SwatchProps, 'color' | 'onChange'> {
color?: string | HsvaColor;
onChange?: (color: ColorResult) => void;
}
License
Licensed under the MIT License.