Skip to content

ColorPicker

Color picker with HEX, RGB, HSL, and OKLCH formats, alpha channel, optional swatches, and an eyedropper. Available as an inline panel or popover.

Installation

Install ColorPicker from the Fluid Effect UI registry.

Default

The screen eyedropper appears in browsers that expose the native EyeDropper API on secure pages.

Arrow keys adjust saturation and brightness. Shift uses larger steps.

#

Popover

With Swatches

Arrow keys adjust saturation and brightness. Shift uses larger steps.

#

OKLCH Format

Arrow keys adjust saturation and brightness. Shift uses larger steps.

Controlled

Arrow keys adjust saturation and brightness. Shift uses larger steps.

#

Current: #6B97FF#6B97FF

Removable Trigger

API Reference

Types come from the public API. A dash indicates no default is documented here.

ColorPicker props

Public source
PropTypeDefaultDescription
keyKeepAliveKey<K, Ends> | undefined''The child's identity among its parent's children of one component, or a kept child's among its author's. The empty string by default.
onEmit
Show type
((events: { readonly _tag: "Committed"; readonly value: string; readonly hex: string; } | { readonly _tag: "ChangeRequested"; readonly value: string; readonly hex: string; } | { readonly _tag: "FormatChangeRequested"; readonly format: "hex" | "rgb" | "hsl" | "oklch"; }) => NoInfer<Msg> | undefined) | { readonly ChangeRequested: (event: { readonly _tag: "ChangeRequested"; readonly value: string; readonly hex: string; }) => NoInfer<Msg> | undefined; readonly Committed: (event: { readonly _tag: "Committed"; readonly value: string; readonly hex: string; }) => NoInfer<Msg> | undefined; readonly FormatChangeRequested: (event: { readonly _tag: "FormatChangeRequested"; readonly format: "hex" | "rgb" | "hsl" | "oklch"; }) => NoInfer<Msg> | undefined; } | undefined
—Handle the child's events with a callback, or supply one handler per tag for tagged events. Return a parent message to dispatch it, or `undefined` to ignore the event.
props.idstringRequired
props.valuestringRequired
props.labelstring'Color picker'
props.disabledbooleanfalse
props.size"default" | "compact"'default'
props.reducedMotion"user" | "always" | "never"'user'
props.classNamestring—
props.shape"rounded" | "pill" | "sharp"'rounded'
props.format"hex" | "rgb" | "hsl" | "oklch"'hex'
props.localestring—
props.swatchesreadonly (string | { readonly color: string; readonly label?: string; })[]—
props.hideEyedropperboolean—
ColorPickerPopover
Public source
PropTypeDefaultDescription
keyKeepAliveKey<K, Ends> | undefined''The child's identity among its parent's children of one component, or a kept child's among its author's. The empty string by default.
onEmit
Show type
((events: { readonly _tag: "ChangeRequested"; readonly value: string; readonly hex: string; } | { readonly _tag: "Committed"; readonly value: string; readonly hex: string; } | { readonly _tag: "FormatChangeRequested"; readonly format: "hex" | "rgb" | "hsl" | "oklch"; } | { readonly _tag: "OpenChangeRequested"; readonly open: boolean; readonly reason: "trigger-press" | "outside-press" | "escape-key" | "focus-out" | "close-press" | "trigger-hover" | "close-watcher"; } | { readonly _tag: "RemoveRequested"; }) => NoInfer<Msg> | undefined) | { readonly ChangeRequested: (event: { readonly _tag: "ChangeRequested"; readonly value: string; readonly hex: string; }) => NoInfer<Msg> | undefined; readonly Committed: (event: { readonly _tag: "Committed"; readonly value: string; readonly hex: string; }) => NoInfer<Msg> | undefined; readonly FormatChangeRequested: (event: { readonly _tag: "FormatChangeRequested"; readonly format: "hex" | "rgb" | "hsl" | "oklch"; }) => NoInfer<Msg> | undefined; readonly OpenChangeRequested: (event: { readonly _tag: "OpenChangeRequested"; readonly open: boolean; readonly reason: "trigger-press" | "outside-press" | "escape-key" | "focus-out" | "close-press" | "trigger-hover" | "close-watcher"; }) => NoInfer<Msg> | undefined; readonly RemoveRequested: (event: { readonly _tag: "RemoveRequested"; }) => NoInfer<Msg> | undefined; } | undefined
—Handle the child's events with a callback, or supply one handler per tag for tagged events. Return a parent message to dispatch it, or `undefined` to ignore the event.
props.idstringRequired
props.valuestringRequired
props.openbooleanRequired
props.labelstring'Color picker'
props.disabledbooleanfalse
props.size"default" | "compact"'default'
props.reducedMotion"user" | "always" | "never"'user'
props.classNamestring—
props.shape"rounded" | "pill" | "sharp"'rounded'
props.format"hex" | "rgb" | "hsl" | "oklch"'hex'
props.localestring—
props.swatchesreadonly (string | { readonly color: string; readonly label?: string; })[]—
props.hideEyedropperboolean—
props.triggerClassNamestring—
props.triggerLabelstring'color'
props.triggerAriaLabelstringh.props.triggerLabel
props.triggerShowValueboolean—
props.triggerShowRemoveboolean—
slotsSC & CheckedSlots<"footer", SC, NoInfer<Msg>>—