Skip to content
ArcadiaDesign
BugDesignBackendBillingOnboardingCustomerChore

TSX

A label is a category a team makes: a name and a colour. It has no ground of its own: an outlined control's hairline round a dot and the name, on whatever surface it stands on, so the words stay ink, the hue is only in the dot and the dot is read on the surface itself. A removable label uses the chip's 20px remove button.

Its colour is one of LABEL_HUES, the six chart series, stored by id (chart-1 to chart-6, so a stored label never depends on a colour's word), or none, a grey dot. They are the kit's data colours: each reads on every surface in both themes and none is mistaken for another by the common colour visions, and a label keeps its colour as its series in a chart of labels. Never a status tone, so a red label never reads as an error, and never a picked colour, which one theme or the other cannot read. Six hues for more labels repeat: the name is a label's identity, the dot an aid.

Examples

Choosing a colour

HuePicker is the hues as a row of dots, the grey last, each named by its colour's word.

Design

Where the room has gone

dotOnly keeps the dot alone, its name its hint and what a reader hears; two labels of one hue are still two dots.

A label reads as its name, and its remove button as "Remove" and the name. A dot alone is an image named by the label's name, which its tooltip shows. The hue picker is a radio group named Color, one Tab stop, the arrows choosing; each dot is named by its colour's word (Blue, Teal, Violet, Amber, Pink, Rust and Grey). No meaning rests on a colour alone (C14).

Label

hue
LabelHueDefault "none"
Its colour, one of LABEL_HUES by id, or none.
dotOnly
booleanDefault false
The dot alone, where the room has gone: the name is its accessible name and its hint.
onRemove
() => void
Renders a trailing xs IconButton in the chip's ink.
removeLabel
stringDefault "Remove"
The remove button's label and tooltip.
removeHint
ReactNode
Extra tooltip line for the remove button, e.g. the shortcut's effect.
rootStyle
ChipStyle
Typed StyleX override: where the chip sits and its --chip-* knobs.
childrenrequired
string
Its name.
className
string
A product's hook class, retiring: new code uses rootStyle (ui.lint kit-classname counts the rest).

Rest props go to <span> props and render.

valuerequired
LabelHue
The hue chosen.
onChangerequired
(hue: LabelHue) => void
size
"sm" | "md" | "lg"Default "sm"
rootStyle
RootStyle
Typed StyleX override: where the row sits.

Rest props go to <div> props.