Skip to content
ArcadiaDesign

TSX

One colour to choose, as a round swatch: the colour a step inside its circle with a hairline, so black reads on the night page and white on paper, and an ink ring round the one chosen, never the accent. Its label is its name, read and shown as its tooltip; colour alone never says which it is. With onPick it is any other colour: a wheel of hues that opens the platform's own picker, the colour picked in its middle while chosen.

The row above is MARKING_INKS, a person's marking inks: the colours a picture is marked with, fixed values that are the same in either theme and in every product, because a mark is drawn into the picture's own pixels and read back as data. They are the only literal colours outside the kit's tokens. A row of swatches that is one choice is a radiogroup of swatches with role="radio", one Tab stop, the arrows choosing, as the markup editor's is.

Examples

Sizes

sm 24, md 28, lg 32 (the default): a control's heights. A swatch in a tight row shrinks to 24 before it wraps.

Size and state

A button named by its label, its state aria-pressed, or aria-checked as a radio in a group. The picker swatch is the platform's colour field, named by its label too. A chosen swatch is told apart by its ring, a full step of ink, and by its name.

Swatch

colorrequired
string
The colour it shows, #rrggbb or a token's var(). With onPick, the colour last picked (#rrggbb), shown in its middle while it is selected.
labelrequired
string
Required: its name, which is its accessible name and its tooltip.
selected
booleanDefault false
It is the colour chosen: an ink ring round it. As a radio, aria-checked; else aria-pressed.
onPick
(color: string) => void
Any other colour: a wheel of hues that opens the platform's own picker, handing back the colour picked.
size
"sm" | "md" | "lg"Default "lg"
sm 24, md 28, lg 32.
tooltip
false
false: no tooltip, where its name already stands beside it.
rootStyle
RootStyle
Typed StyleX override: layout.

Rest props go to <button> props.