Chroma Panel

Search documentation

Find a page or section

NumberField

A numeric input for one channel.

Anatomy

import { NumberField } from "chroma-panel";

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
label*stringAccessible name for the field.
min*numberLowest value accepted.
max*numberHighest value accepted.
stepnumber1Arrow-key increment.
read*(color: Hsva) => numberPulls this channel's value out of the current colour.
write*(value: number, current: Hsva) => HsvaMerges a typed value back into the colour.
classNamestringClass on the field.