React Color Shade Slider
ShadeSlider Component is a subcomponent of @react-color
.
Install
npm i @uiw/react-color-shade-slider
Usage
import ShadeSlider from '@uiw/react-color-shade-slider';
function Demo() {
const [hsva, setHsva] = useState({ h: 0, s: 0, v: 68, a: 1 });
return (
<ShadeSlider
hsva={hsva}
onChange={(newShade) => {
setHsva({ ...hsva, ...newShade });
}}
/>
);
}
Props
import React from 'react';
import { AlphaProps } from '@uiw/react-color-alpha';
export interface ShadeSliderProps extends Omit<AlphaProps, 'onChange'> {
onChange?: (newShade: {
v: number;
s: number;
}) => void;
}
License
Licensed under the MIT License.