Skip to main content

Color Picker

A swatch that opens a popover for picking a hex color.

import { ColorPicker } from '@jbpark/ui-kit';

<ColorPicker value={color} onChange={setColor} showText />;

Props

PropTypeDefault
valuestring-
defaultValuestring'#fff'
showTextboolean-
disabledboolean-
onChange(color: string) => void-
openboolean-
defaultOpenboolean-
onOpenChange(open: boolean) => void-
classNamestring-

showText renders the current hex value next to the swatch. Works both controlled (pass value + onChange) and uncontrolled (pass defaultValue, or neither).