Usage
ColorWheel is a circular hue selector. Its value is a hue in degrees, from 0 at the top (red)
increasing clockwise to 360:
Controlled
Convert the value to a color with hsl(hue, 100%, 50%) or any color conversion function:
Hue: 210°
Ring colors
Use saturation and lightness props (0 to 100) to change the ring colors.
They change only the appearance, the value is always the hue:
saturation=100 lightness=50
saturation=60 lightness=70
onChangeEnd
onChangeEnd is called when the user stops dragging the wheel or changes the value with the keyboard.
Use it as a debounced callback to avoid too frequent updates:
Current value: 0
End value: 0
Disabled
Set disabled to prevent user interaction:
ColorWheel with uncontrolled forms
Set name prop to include the hue value in the FormData object on form submission
and defaultValue to set the initial value:
Accessibility
Set aria-label to make the wheel accessible for screen readers:
Keyboard interactions
When the thumb is focused, arrow keys wrap around at 0 and 360:
Based on use-radial-move
ColorWheel is based on the use-radial-move hook.
Use it to build a custom radial selector: