Color Slider

A color slider allows users to adjust an individual channel of a color value.

<ColorSlider aria-label="Hue" channel="hue" defaultValue="hsl(200, 100%, 50%)">
  <ColorSliderControl />
</ColorSlider>

Installation

npx shadcn@latest add @dotui/color-slider

Usage

Use color sliders to allow users to adjust an individual channel of a color value.

import { ColorSlider, ColorSliderControl } from "@/components/ui/color-slider";
import { Label } from "@/components/ui/field";
<ColorSlider defaultValue="#ff0000" channel="hue">
	<Label>Hue</Label>
	<ColorSliderControl />
</ColorSlider>

Playground

Use the controls below to experiment with different color slider props and see the live preview and code update.

channel
orientation
<ColorSlider
  defaultValue="hsl(0, 100%, 50%)"
  channel="hue"
  orientation="horizontal"
>
  <Label>hue</Label>
  <ColorSliderControl />
</ColorSlider>

Examples

100%

Value: #FF0000

API Reference

ColorSlider

A color slider allows users to adjust an individual channel of a color value.

PropType
ColorChannel
ReactNode | function
ColorSpace
boolean
Orientation
DOMRenderFunction<"div", ColorSliderRenderProps>
Color | string
Color | string
function
function

ColorSliderControl

Missing description.

PropType
ReactNode | function
DOMRenderFunction<"div", SliderTrackRenderProps>

Last updated on 5/22/2026