Color Picker

Pill swatch trigger with hex or clear trailing, and channel editors in a popover.

Installation

Add this item from the registry, or import it from the package after installing Default File UI.

Registry path

itsvigneshv/default-file-ui/color-picker

Package import

import { ColorPicker } from "@default-file/ui/components/df-color-picker"

With hex

Pill trigger shows the hex value. The whole pill opens the picker.

With clear

Replace the hex with an X. The pill still opens the picker; X fires onClear.

Properties

Pill swatch trigger with optional hex or clear trailing, and channel editors in a popover.

ColorPicker

PropTypeDefaultNotes
valuestringCurrent color as a hex string (required).
onChange(hex: string) => voidCalled when the color changes (required).
labelstring"Pick color"Accessible name for the swatch trigger.
trailing"hex" | "clear"Optional trailing control: show hex text, or a clear action.
onClear() => voidRequired when trailing is "clear".
clearLabelstring"Remove color"Accessible label for the clear control.
classNamestringAdditional styles on the root.

Layout & appearance

PropTypeDefaultNotes
Popover editorsinternal UIOpened panel supports hex, rgb, hsl, and hsb channel modes (not separate props).