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
Removable Trigger
API Reference
Types come from the public API. A dash indicates no default is documented here.
ColorPicker props
Public source| Prop | Type | Default | Description |
|---|---|---|---|
key | KeepAliveKey<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.id | string | Required | |
props.value | string | Required | |
props.label | string | 'Color picker' | |
props.disabled | boolean | false | |
props.size | "default" | "compact" | 'default' | |
props.reducedMotion | "user" | "always" | "never" | 'user' | |
props.className | string | — | |
props.shape | "rounded" | "pill" | "sharp" | 'rounded' | |
props.format | "hex" | "rgb" | "hsl" | "oklch" | 'hex' | |
props.locale | string | — | |
props.swatches | readonly (string | { readonly color: string; readonly label?: string; })[] | — | |
props.hideEyedropper | boolean | — |
ColorPickerPopover
Public source
| Prop | Type | Default | Description |
|---|---|---|---|
key | KeepAliveKey<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.id | string | Required | |
props.value | string | Required | |
props.open | boolean | Required | |
props.label | string | 'Color picker' | |
props.disabled | boolean | false | |
props.size | "default" | "compact" | 'default' | |
props.reducedMotion | "user" | "always" | "never" | 'user' | |
props.className | string | — | |
props.shape | "rounded" | "pill" | "sharp" | 'rounded' | |
props.format | "hex" | "rgb" | "hsl" | "oklch" | 'hex' | |
props.locale | string | — | |
props.swatches | readonly (string | { readonly color: string; readonly label?: string; })[] | — | |
props.hideEyedropper | boolean | — | |
props.triggerClassName | string | — | |
props.triggerLabel | string | 'color' | |
props.triggerAriaLabel | string | h.props.triggerLabel | |
props.triggerShowValue | boolean | — | |
props.triggerShowRemove | boolean | — | |
slots | SC & CheckedSlots<"footer", SC, NoInfer<Msg>> | — |