
Product
Introducing Rust Support in Socket
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
@uiw/react-color-slider
Advanced tools
Slider Component is a subcomponent of @react-color
.
npm i @uiw/react-color-slider
import React, { useState } from 'react';
import Slider from '@uiw/react-color-slider';
export default function Demo() {
const [hsva, setHsva] = useState({ h: 0, s: 0, v: 68, a: 1 });
return (
<Slider
color={hsva}
onChange={(color) => {
setHsva({ ...hsva, ...color.hsv });
}}
/>
);
}
import React, { useState } from 'react';
import Slider from '@uiw/react-color-slider';
import Wheel from '@uiw/react-color-wheel';
export default function Demo() {
const [hsva, setHsva] = useState({ h: 0, s: 0, v: 68, a: 1 });
return (
<>
<Slider
color={hsva}
style={{ paddingBottom: 10 }}
onChange={(color) => {
setHsva({ ...hsva, ...color.hsv });
}}
/>
<Wheel
color={hsva}
onChange={(color) => setHsva({ ...hsva, ...color.hsva })}
/>
</>
);
}
import React, { useState } from 'react';
import Slider from '@uiw/react-color-slider';
export default function Demo() {
const [hsva, setHsva] = useState({ h: 0, s: 0, v: 0, a: 1 });
return (
<Slider
color={hsva}
onChange={(color) => {
setHsva({ ...hsva, ...color.hsv });
}}
customColorShades={[
{ color: '#000000', lightness: [50, 40, 30, 20, 10] },
{ color: '#ffffff', lightness: [95, 90, 80, 70, 60] },
]}
/>
);
}
import React from 'react';
import { ColorResult, HsvaColor } from '@uiw/color-convert';
export interface SliderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'color'> {
prefixCls?: string;
color?: string | HsvaColor;
lightness?: number[];
customColorShades?: {
color: string | HsvaColor;
lightness: number[];
}[];
onChange?: (color: ColorResult, evn: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
}
declare const Slider: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<HTMLDivElement>>;
export default Slider;
As always, thanks to our amazing contributors!
Made with contributors.
Licensed under the MIT License.
FAQs
Color Slider component for React.
The npm package @uiw/react-color-slider receives a total of 41,591 weekly downloads. As such, @uiw/react-color-slider popularity was classified as popular.
We found that @uiw/react-color-slider demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.