API and Development
Label provides accessible labels for form controls, helping users understand what information is expected and ensuring proper association between labels and their inputs. It displays descriptive text associated with form fields, supporting semantic color variants and inline layouts. Built on Radix UI's Label component, it ensures proper accessibility and visual consistency across the interface.
| Name | Type | Default | Description |
|---|---|---|---|
text | LocalizedMessage | — | Visible label copy from the caller. |
action | ReactNode | — | Trailing affordance on the label row, such as a link-styled control (ui-core WithAction). |
children | ReactNode | — | Control or row content when the label wraps its field instead of using htmlFor. |
className | string | — | Classes on the label host. Put overrides in @layer chroma.overrides. |
disabled | boolean | — | When true, paints the label with the disabled foreground and not-allowed cursor, as when the
associated control is unavailable. Field sets this from its own disabled prop. |
foreground | Foreground.Default | Foreground.Subtle | Foreground.Disabled | — | Foreground for the label text. Defaults to default; status colors are excluded (LBL-8). |
ref | Ref<HTMLLabelElement> | — | Ref to the rendered label. |
required | boolean | — | When true, renders an aria-hidden required marker after the text inside {@link Text} (LBL-1). |
type | TextType.BodyLarge | TextType.BodyLargeEmphasis | TextType.BodyMedium | TextType.BodyMediumEmphasis | TextType.Label | TextType.Caption | TextType.CaptionEmphasis | — | Chroma typography role for the label text. Defaults to the label role (LBL-9). |
action prop to place a link Button at the trailing edge of a block label row—for example, "Forgot password?" beside a password field. The action is ignored when inline is set.