ColorPicker

Compact colour picker — a native swatch chip that opens the OS picker, a hex input beside it, and a grid of preset swatches below. Use it for theme settings, brand editors, custom badge colours.

Accent
--bwo-accent: #ff481f

Usage

import { ColorPicker } from '@bwo-ui/react';

const [accent, setAccent] = useState('#ff481f');

<ColorPicker
  label="Accent"
  value={accent}
  onValueChange={setAccent}
  swatches={['#ff481f', '#7463ff', '#16a34a', '#0ea5e9']}
/>

Props

PropTypeDefaultDescription
valuestringControlled hex value.
defaultValuestring'#ff481f'Uncontrolled default.
onValueChange(color: string) => voidFires with a normalised hex.
swatchesstring[]Preset palette rendered as the swatch grid.
showNativebooleantrueShow the OS colour picker on the chip.
showHexbooleantrueShow the hex input.
labelReactNodeInline label rendered above the field.