XiodUI
HomeDocs
OverviewComponentsStyling & CustomizationChangelog

Components

  • Accordion
  • Agent Steps
  • Alert
  • Alert Dialog
  • Aspect Ratio
  • Autocomplete
  • Avatar
  • Badge
  • Breadcrumb
  • Button
  • Button Group
  • Button Split
  • Calendar
  • Card
  • Carousel
  • Checkbox
  • Circular Progress
  • Collapsible
  • Color Picker
  • Combobox
  • Command
  • Context Menu
  • Copy To Clipboard
  • Corner Badge
  • Dashboard Grid
  • Date Picker
  • Dialog
  • Dot Matrix
  • Draggable
    Updated
  • Drawer
  • Empty
  • Field
  • Fieldset
  • File Upload
    Updated
  • Form
  • Frame
  • Gauge
  • Grid
  • Group
  • Input
  • Input Group
  • Input OTP
  • Input Payment
  • Input Phone
    Updated
  • Input Sensitive
  • Kbd
  • Kinetic Click
  • Label
  • List Box
    Updated
  • Loader
  • Marker
  • Menu
  • Menubar
  • Message
  • Meter
  • Morphic Toast
  • Navigation Menu
  • Number Field
  • Option Picker
  • Orb
  • Pagination
  • Popover
  • Preview Card
    Updated
  • Progress
  • Radio
  • Resizable
  • Ruler Picker
  • Scroll Area
  • Scroll Bar
  • Select
  • Separator
  • Sidebar
  • Skeleton
  • Slider
  • Sortable
  • Switch
  • Table
  • Tabs
  • Text
  • Textarea
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Toolbar
  • Tooltip
  • Waveform
  • Wheel Picker

Loading...

Preview Skeleton

Installation Skeleton

Usage Skeleton

API Reference Skeleton

Sponsors

Support the development of XiodUI and help us build the best component library on Earth.

+++
Sponsor on GitHub

Color Picker

Previous: CollapsibleNext: Combobox

A radial colour picker with hue, saturation and alpha controls.

Preview

Loading Preview...

Installation

bun add xiod-ui

Usage

Imports

1import { BlossomColorPicker, ColorPicker } from "xiod-ui/color-picker";

API Reference

Detailed documentation of properties and options.

BlossomColorPicker

Accepts render, plus every native attribute of the element it renders.

PropTypeDefaultDescription
adaptivePositioning
boolean
true

Whether the open picker shifts to stay inside the window, and places its sliders where there is room when sliderPosition is unset.

animationDuration
CollapsibleCombobox
number
300

How long the petals take to open and close, in milliseconds.

circularBarWidth
number
12

The thickness of the ring that shows the selected colour around the petals, in pixels.

collapsible
boolean
true

Whether the picker closes to its centre button. When false, it stays open.

colors
ColorInput[]
–

The petal colours, as hex, rgb() or hsl() strings or { h, s, l } objects. Up to 10 sit in one ring; more are split into rings by lightness.

coreSize
number
32

The diameter of the centre button, in pixels.

defaultValue
BlossomColorPickerValue
–

The colour selected at first, when it isn't controlled.

disabled
boolean
false

Whether the picker ignores input.

initialExpanded
boolean
false

Whether the picker starts open.

labels
Partial<ColorPickerLabels>
–

Replaces the built-in text for this instance. See LabelsProvider to change it everywhere.

onChange
((color: BlossomColorPickerColor) => void)
–

Called with the new colour, in every format, whenever it changes.

onCollapse
((color: BlossomColorPickerColor) => void)
–

Called with the selected colour when the picker closes.

openOnHover
boolean
false

Whether hovering the picker opens it, as well as clicking. Only applies when collapsible.

petalSize
number
32

The diameter of each petal, in pixels.

showCoreColor
boolean
true

Whether the centre shows the selected colour while open. When false, it turns white while open.

showLightnessSlider
boolean
–

Whether to show the Lightness arc slider beside the petals while open.

showOpacitySlider
boolean
true

Whether to show the Opacity arc slider, on the side opposite the Lightness slider, while open.

sliderOffset
number
30

The distance between the colour ring and the arc sliders, in pixels.

sliderPosition
"top"|"bottom"|"left"|"right"
–

The side the Lightness slider sits on. The Opacity slider takes the opposite side. When unset, the picker picks the side with the most room.

sliderWidth
number
12

The thickness of the arc sliders, in pixels.

value
BlossomColorPickerValue
–

The selected colour. Use with onChange to control it.

ColorPicker

Accepts className and render, plus every native attribute of the element it renders.

PropTypeDefaultDescription
adaptivePositioning
boolean
true

Whether the open picker shifts to stay inside the window, and places its sliders where there is room when sliderPosition is unset.

animationDuration
number
300

How long the petals take to open and close, in milliseconds.

circularBarWidth
number
12

The thickness of the ring that shows the selected colour around the petals, in pixels.

collapsible
boolean
false

Whether the picker closes to its centre button. When false, it stays open.

colors
ColorInput[]
–

The petal colours, as hex, rgb() or hsl() strings or { h, s, l } objects. Up to 10 sit in one ring; more are split into rings by lightness.

coreSize
number
36

The diameter of the centre button, in pixels.

darkMode
boolean
–

Whether the panel always uses dark colours, whatever the page's theme.

defaultFormat
"hex"|"rgba"|"hsla"
–

The format the fields show at first, when it isn't controlled.

defaultValue
BlossomColorPickerValue
–

The colour selected at first, when it isn't controlled.

disabled
boolean
false

Whether the picker ignores input.

format
"hex"|"rgba"|"hsla"
–

The format the fields show. Use with onFormatChange to control it.

formats
ColorPickerFormat[]
["hex", "rgba", "hsla"]

The formats the switch cycles through, in order. With one format, the switch is hidden.

initialExpanded
boolean
true

Whether the picker starts open.

labels
Partial<ColorPickerLabels>
–

Replaces the built-in text for this instance. See LabelsProvider to change it everywhere.

onChange
((color: BlossomColorPickerColor) => void)
–

Called with the new colour, in every format, whenever it changes.

onCollapse
((color: BlossomColorPickerColor) => void)
–

Called with the selected colour when the picker closes.

onFormatChange
((format: ColorPickerFormat) => void)
–

Called when the format switch changes the format.

openOnHover
boolean
false

Whether hovering the picker opens it, as well as clicking. Only applies when collapsible.

petalSize
number
32

The diameter of each petal, in pixels.

showCoreColor
boolean
true

Whether the centre shows the selected colour while open. When false, it turns white while open.

showLightnessSlider
boolean
–

Whether to show the Lightness arc slider beside the petals while open.

sliderOffset
number
30

The distance between the colour ring and the arc sliders, in pixels.

sliderPosition
"top"|"bottom"|"left"|"right"
–

The side the Lightness slider sits on. The Opacity slider takes the opposite side. When unset, the picker picks the side with the most room.

sliderWidth
number
12

The thickness of the arc sliders, in pixels.

triggerIcon
ReactNode
–

Replaces the icon on the colour format switch. Accepts any node; null renders no icon. Takes precedence over IconProvider.

value
BlossomColorPickerValue
–

The selected colour. Use with onChange to control it.