Usage
rgba(47, 119, 150, 0.7)
Color format
Component supports hex, rgb, rgba, hsl and hsla color formats. Slider to change opacity is displayed only for rgba and hsla formats:
#C5D899
With swatches
You can add any amount of predefined color swatches:
By default there will be 10 swatches per row, you can change this with swatchesPerRow
prop:
To display swatches without picker set withPicker={false}
and fullWidth
props:
Size
Component has 5 predefined sizes: xs, sm, md, lg and xl:
Size
xs
sm
md
lg
xl
AlphaSlider
You can import and use AlphaSlider and HueSlider components outside of ColorPicker:
Alpha value: 1
Size
xs
sm
md
lg
xl
HueSlider
Hue value: 250
Size
xs
sm
md
lg
xl
Accessibility and usability
ColorPicker, AlphaSlider and HueSlider components are accessible by default:
- Saturation, hue and alpha sliders are focusable
- When user uses mouse to interact with slider, focus is moved on slider
- All values can be changed with arrows
To make component visible for screen readers provide following props:
Feedback
Your feedback is most valuable contribution to the project, please share how you use Mantine, what features are missing and what is done good
Leave feedback