ColorPicker

<ColorPicker>TailwindCSS Modules

Untitled UI–style solid color pickers (spectrum, minimal, swatches, brand/gray, palette) plus a separate GradientPicker for multi-stop linear/radial gradients, and standalone hue/alpha sliders.

InstallationColoxo CLI
npx coloxo add color-picker --style coloxo-css
ES Module ImportPlayground / npm package
import { ColorPicker, GradientPicker, ColorHueSlider, ColorAlphaSlider } from '@coloxo/ui';

Design Tokens:

--cx-brand-600: #2348FF--cx-bg-primary: #FFFFFF--cx-border-primary--cx-radius-xl: 12px

1. Variant Matrix

ColorPicker variants for solid colors; GradientPicker is a separate component type.

SolidGradientSwatchesBrandMinimalPalette
Inline
linear-gradient(90deg, #2348ff 0%, #db2777 100%)
brand
gray
red
orange
amber
yellow
lime
green
teal
cyan
blue
indigo
violet
purple
fuchsia
pink
rose

2. Control heights (Sizes)

Trigger field heights match other Coloxo form controls (sm / md / lg).

Sizes

size="sm"
Height: 36px (2.25rem)

Dense toolbars, table cells

size="md"DEFAULT
Height: 40px (2.5rem)

Standard forms & settings

size="lg"
Height: 44px (2.75rem)

Hero brand / theme panels

3. Features

Standalone GradientPicker, hue/alpha sliders, saved swatch sizes, format switching, and eye dropper.

GradientPicker (separate type)

linear-gradient(90deg, #2348ff 0%, #db2777 100%)

Hue slider

Transparency slider

Saved swatches — small

Saved swatches — medium

Popover trigger (field)

Opens the solid spectrum picker.

4. Interactive Props Configurator

Show alpha

Eye dropper

Inline panel

Visual Render CanvasTYPE: SOLID | SIZE: MD

Selected: #2348ff

tsx
<ColorPicker  value="#2348ff"  onChange={setColor}  inline  label="Brand color"/>

5. Dark theme

Panel surfaces, borders, and inputs follow `[data-cx-theme]` tokens.

6. Enterprise layout compositions

Typical product placements — theme settings and tag / category colors.

Workspace theme
Brand accent used across the console
Label color
Pick from saved swatches

Accessibility

React Aria primitives

Color area, sliders, and swatch grid use React Aria keyboard and pointer interactions with proper ARIA roles.

Focus rings

Thumbs, swatches, and format fields show Coloxo brand focus rings for keyboard users.

Eye dropper

Chromium EyeDropper API when available; the control is omitted in unsupported browsers.

Props

NameTypeDefaultDescription
value / defaultValuestring#2348ffCSS / hex color string.
onChange(hex: string, color: Color) => void—Color change handler.
variant"solid" | "minimal" | "swatches" | "brand" | "gray" | "palette"solidSolid ColorPicker panel layout. Use GradientPicker for gradients.
size"sm" | "md" | "lg"mdTrigger field height.
swatchesstring[]—Custom swatch list for swatches/brand/gray.
swatchSize"sm" | "md"mdSaved swatch cell size.
showAlphabooleantrueShow transparency slider.
showEyeDropperbooleantrueChromium EyeDropper button.
format / defaultFormat"hex" | "rgb" | "hsl" | "hsb"hexValue input model.
inlinebooleanfalseRender panel without popover.
hideTriggerbooleanfalsePanel only (use with inline).
label / description / errorReactNode—FormField chrome.