Options

Blossom Color Picker exposes the same core option set across the standalone package and all framework wrappers.

value and defaultValue use the BlossomColorPickerValue shape, while colors accepts ColorInput[]. See Types & Colors for the full value reference.

Configuration Reference

OptionTypeDefaultDescription
valueBlossomColorPickerValue-Controlled value for the picker.
defaultValueBlossomColorPickerValue{ hue: 330, saturation: 70, alpha: 50, layer: 'outer' }Initial value used when the picker is uncontrolled.
colorsColorInput[]DEFAULT_COLORSCustom color set. The core automatically organizes these colors into blossom layers.
onChange(color: BlossomColorPickerColor) => void-Called whenever the selected color changes.
onCollapse(color: BlossomColorPickerColor) => void-Called when the picker collapses.
disabledbooleanfalseDisables user interaction.
openOnHoverbooleanfalseExpands the picker on hover.
initialExpandedbooleanfalseStarts with the picker expanded.
animationDurationnumber300Duration of the bloom animation in milliseconds.
showAlphaSliderbooleantrueShows the outer arc slider around the petals.
coreSizenumber32Diameter of the center core button in pixels.
petalSizenumber32Diameter of each petal in pixels.
showCoreColorbooleantrueDisplays the selected color in the core.
sliderPosition'top' | 'bottom' | 'left' | 'right'undefinedFixed position for the arc slider. If omitted, the picker starts from the right side and may reposition automatically.
adaptivePositioningbooleantrueAutomatically shifts the expanded picker and arc slider to keep them visible inside the viewport.
circularBarWidthnumber12Width of the circular hue bar in pixels.
sliderWidthnumber12Width of the outer arc slider track and handle in pixels.
sliderOffsetnumber30Space between the petals and the outer arc slider.
collapsiblebooleantrueAllows the picker to collapse.

ChromePicker uses the same options, except collapsible defaults to false.

Framework Event Names

  • React: onChange and onCollapse
  • Vue: @change and @collapse
  • Svelte: onchange and oncollapse callback props
  • Angular: (colorChange) and (colorCollapse)

Returned Color Object

The onChange and onCollapse callbacks receive a BlossomColorPickerColor object:

interface BlossomColorPickerColor {
  hex: string;
  hsl: string;
  hsla: string;
  rgb: string;
  rgba: string;
  r: number;
  g: number;
  b: number;
  hue: number;
  saturation: number;
  lightness: number;
  alpha: number;
  layer: 'inner' | 'outer';
}

Custom Colors

You can provide your own set of colors to display as petals:

<BlossomColorPicker
  colors={[
    '#FF6B6B',
    'rgb(107, 203, 119)',
    'rgba(65, 105, 225, 0.9)',
    'hsl(280, 70%, 55%)',
    { h: 45, s: 90, l: 65 },
  ]}
/>

For the full value shape and supported colors formats, see Types & Colors.

On this page