ColorPicker

Pick one of the catalogue colours.

<ColorPicker value={color} onValueChange={setColor} />

The palette is the closed Badge colour set, so a colour picked here is a name you can store and render as a chip anywhere. It is not a free-form colour wheel, on purpose.

API

PropTypeDefault
classNamestring
clearablebooleanfalseOffer a clear affordance that reports null.
clearLabelstring"Clear selection"
contentClassNamestring
defaultValue"amber" | "blue" | "cyan" | "emerald" | "fuchsia" | "gray" | "green" | "indigo" | "lime" | "orange" | "pink" | "purple" | "red" | "rose" | "sky" | "slate" | "teal" | "violet" | "yellow" | "zinc" | nullnullInitial selection for uncontrolled usage.
disabledbooleanfalse
namestringWhen set, renders a hidden input so plain form posts include the color.
onValueChange((color: "amber" | "blue" | "cyan" | "emerald" | "fuchsia" | "gray" | "green" | "indigo" | "lime" | "orange" | "pink" | "purple" | "red" | "rose" | "sky" | "slate" | "teal" | "violet" | "yellow" | "zinc" | null) => void)
placeholderstring"Select a color"
value"amber" | "blue" | "cyan" | "emerald" | "fuchsia" | "gray" | "green" | "indigo" | "lime" | "orange" | "pink" | "purple" | "red" | "rose" | "sky" | "slate" | "teal" | "violet" | "yellow" | "zinc" | nullControlled selection; omit to let the picker manage its own state.

Plus the DOM props of the element it renders. Source: color-picker/components/color-picker.tsx.