@uiw/react-color-shade-slider
v2.3.4
Published
Color ShadeSlider component for React.
Downloads
107,389
Readme
React Color Shade Slider
ShadeSlider Component is a subcomponent of @react-color
.
Install
npm i @uiw/react-color-shade-slider
Usage
import React, { useState } from 'react';
import ShadeSlider from '@uiw/react-color-shade-slider';
export default 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;
}) => void;
}
declare const ShadeSlider: React.ForwardRefExoticComponent<ShadeSliderProps & React.RefAttributes<HTMLDivElement>>;
export default ShadeSlider;
Contributors
As always, thanks to our amazing contributors!
Made with contributors.
License
Licensed under the MIT License.