Skip to content
uiify

Color picker

Color input built on the native color picker.

Browsers
Chrome 123+Firefox 121+Safari 17.5+
Tier
1
Bundle compressed
1.21 kB
Forced layout budget
0 ms
Axe budget
0
SSR compatible
Yes
Published contract
Test harness

Playground

Color Picker

API

ColorPicker

PropTypeDefaultDescription
label*string—Visible label for the native color input.
valuestring—Current CSS color string; makes the picker controlled.
defaultValuestring—Starting CSS color string for uncontrolled use, such as "#2563eb".
onValueChange(value: string) => void—Called with the selected color when the native picker changes.
onChangeChangeEventHandler<HTMLInputElement>—Native color-input change event; read the color from currentTarget.value.
alphabooleanfalsePasses the native alpha hint. Browser support and picker UI vary.
colorSpace"limited-srgb" | "display-p3""limited-srgb"Selects the native color-space hint passed to the input.
renderReactElement | ((props, state) => ReactElement)—Replace the rendered element while keeping behavior and accessibility wiring.

Keyboard

KeyAction
TabFocus the color input
Enter / SpaceOpen the native picker

Accessibility

A transparent native <input type="color"> sits above a Field value surface. It is the only form control, stays keyboard-operable, is labeled by Field.Label and opens the system picker; onChange still receives the native event. Before hydration the picker works, but the displayed value stays at its server value. Alpha and display-p3 hints depend on browser support.

Styling hooks

data-uiify-color-pickerdata-uiify-fielddata-uiify-inputdata-disableddata-partdata-value--uiify-color-picker-value