Basic Color Slider
Value: hsl(0, 100%, 50%)
Controlled Color Slider
Value: #ff0000
RGBA Color Picker
Value: rgba(255, 0, 255, 1)
Vertical Orientation
Disabled State
Props
Prop | Type | Default | Description |
---|---|---|---|
channel | string | - | The color channel to display (e.g., "hue", "saturation", "lightness", "red", "green", "blue", "alpha") |
value | Color | - | The current color value (controlled) |
defaultValue | Color | - | The default color value (uncontrolled) |
onChange | (color: Color) => void | - | Handler called when the color changes |
onChangeEnd | (color: Color) => void | - | Handler called when the user stops dragging |
orientation | "horizontal" | "vertical" | "horizontal" | The orientation of the slider |
isDisabled | boolean | false | Whether the slider is disabled |
Keyboard Interactions
Key | Description |
---|---|
Arrow Left/Right | Decreases/increases the value by one step |
Arrow Up/Down | Increases/decreases the value by one step |
Home | Sets the value to the minimum |
End | Sets the value to the maximum |
Page Up/Down | Increases/decreases the value by a larger step |
Starter Kits
Tailwind CSS
Complete ColorSlider implementation with Tailwind CSS styling and dark mode support.
View StarterAccessibility
ColorSlider implements the ARIA slider pattern with the following features:
- Proper ARIA roles and properties
- Keyboard navigation support
- Screen reader announcements with color descriptions
- Focus management
- Touch and mouse interaction support
Feedback
Help us improve this component by providing feedback, asking questions on GitHub, or updating this documentation.