Color Slider
A horizontal or vertical slider used to adjust individual color properties like hue, saturation, or brightness, including labels, orientations, and controlled modes.
Installation
Install the component via the CLI in one command.
npx shadcn@latest add @intentui/color-slider
Composed components
When you install this component via the CLI, it automatically loads all composed components, so you don’t need to add them individually.
Manual installation
Use this approach if you prefer to install and wire up the component yourself instead of using the CLI.
npm install react-aria-components
Anatomy
import { ColorSlider } from "@/components/ui/color-slider"
<ColorSlider channel="hue" />Examples
With label
Enhance the color slider by adding a label for clarity and accessibility.
Orientation
By default, the color slider is horizontal. You can change it to vertical by setting the orientation prop to vertical.
Controlled
Take direct control over the color slider's value.
Disabled
Disable interaction with the color slider using the isDisabled prop.
Component API
ColorSlider
The ColorSlider component lets users adjust one color channel.
| Prop | Type | Default |
|---|---|---|
className | string | - |
ColorSliderOutput
The ColorSliderOutput component displays the current color slider value.
| Prop | Type | Default |
|---|---|---|
className | string | - |
ColorSliderTrack
The ColorSliderTrack component renders the color slider track.
| Prop | Type | Default |
|---|---|---|
className | string | - |
See the React Aria for the full API reference.
Unlock the full power ofIntent UI Design
Build modern web apps faster with 1000+ resources across components, blocks, patterns, templates, and starter kits.