v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS

ColorPicker

A native color picker with accessible naming.

Interactive preview

#087565

Usage

import { ColorPicker, Label } from "@devvy-ui/react";

<Label htmlFor="accent">Accent color</Label>
<ColorPicker id="accent" label="Accent color" name="accent" defaultValue="#087565" />

API reference

Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:

PropTypeDefaultDescription
labelstringrequiredAccessible color name.
value / defaultValue / onChangestring / string / native eventbrowser defaultNative hexadecimal color selection.

Accessibility & behavior

Platform Behavior & Guidelines

Uses type=color and the platform picker. For portable values use six-digit hexadecimal colors; browser support for other formats varies. Preserve a visible label and validate downstream uses. Native disabled, form/reset and refs remain supported.

Source ownership

Run npx @devvy-ui/cli init once in your React project, then add the source:

npx @devvy-ui/cli add color-picker

Make the source yours.

Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.

ColorPicker.tsxREACT / TSX

Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.