Color Picker
A field that opens a list of colours, each with its hex, and a picker for any other colour and its opacity.
Usage
Examples
Appearances
appearance paints the field on the kit's one scale: solid, the default, soft on the grey wash, outline with only its line, and transparent with neither until it is hovered.
Sizes
size sets its height: sm 32px, base 40px (the default) or lg 48px, a Button's height at the same size, the large one written at 16px on a phone.
Border radius
borderRadius sets its corners on the kit's one scale: none, xs 4px, sm 6px, base 8px (the default), lg 12px, xl 16px, or full to round it.
Swatches
swatches lists your own colours, each a row with its hex, above the default palette with a line between them: a brand's colours first, every Tailwind shade after.
Clearable
clearable shows an X at the field's end while it holds a colour, which empties it and gives the field the focus back; by default a field has none.
Disabled
disabled dims the field, keeps the palette shut and leaves its colour out of a form, beside one as it is by default.
Invalid
error writes what is wrong under the field, turns its border to the destructive colour and describes it to screen readers, beside one without an error.
API Reference
ColorPicker
ColorPickerProps · components/ColorPicker/ColorPicker.types.tsIt also takes the props of <button>.