Inputs

Color Picker

Select colors with a color wheel, preset swatches, and a hex input field.

With presets + hex input

Selected: #6366f1

Installation

npx benflux-ui add color-picker

Usage

import { ColorPicker } from "@benflux-ui/react"

const [color, setColor] = useState("#6366f1")

<ColorPicker
  value={color}
  onChange={setColor}
  showInput
  presets={["#ef4444", "#f97316", "#eab308", "#22c55e", "#3b82f6", "#8b5cf6"]}
/>

Props

PropTypeDefaultDescription
valuestringControlled hex color value
onChange(value: string) => voidCallback when color changes
showInputbooleanfalseShow a hex input field below the picker
presetsstring[]Array of preset hex colors to display as swatches
disabledbooleanfalseDisable the color picker