Chroma Panel

Search documentation

Find a page or section

A text input that parses any CSS colour string.

Anatomy

import { ColorField } from "chroma-panel";
 
<ColorField label="Hex" withAlpha />;

See parsing for what it accepts.

Only inside a panel

This is one of the parts the built-in modes are made of. It reads the colour through usePanel(), so it only works inside a ChromaPanel — typically in a custom mode. For a picker outside the panel, use the store and hooks.

API reference

Props

PropTypeDefaultDescription
labelstring'Hex'The label beside the field.
withAlphabooleanfalseAccept and show the alpha channel, so #3366ccff round-trips.
classNamestringClass on the field.