Skip to content

Field Label ​

Props ​

PropTypeDefaultOptionsDescription
htmlForstring""—Associates the label with a control (for attribute). HTML attribute: html-for.
idstring""—Optional id on the root <label>.
alignment"left" | "center" | "right""left"left, center, rightHorizontal alignment of the field label block.
size"m" | "l""m"m, lLabel typography: m → text-m medium; l → text-l medium.
requiredbooleanfalsetrue, falseShows the visual required marker. Pair with required on the control.
requiredScreenReaderTextstring""—Optional screen-reader supplement; it does not replace required on the control (HTML: required-screen-reader-text).
requiredMarkerstring"*"—Visual marker for required fields (HTML: required-marker).
optionalbooleanfalsetrue, falseWhen true and not required, shows the localized optional hint.
optionalTextstring""—Overrides the localized optional hint (HTML: optional-text).
disabledbooleanfalsetrue, falseMutes the label visually when the control is disabled.
flushbooleanfalsetrue, falseRemoves default bottom margin so the parent supplies vertical spacing.
infostring""—When non-empty, renders a trailing catnip-tooltip. Wins over the suffix slot.
testSelectorsTestSelectorsPropSee Test Selectors—Overrides stable data-test values.

See Component API — Props.

Slots ​

NameDescription
(default)Visible label title text.
actionEnd-aligned action on the label row (e.g. catnip-link).
suffixTrailing content beside the title (e.g. custom tooltip anchor). Omitted when info is non-empty.

On composite inputs (catnip-input, etc.), the same patterns use prefixed slot names: label, label.action, label.suffix.

See Component API — Slots.

Events ​

This component has no events.

See Component API — Events.

Test Selectors ​

AttributeDefault Value
rootcatnip-field-label
maincatnip-field-label-main
optionalcatnip-field-label-optional
requiredcatnip-field-label-required
suffixcatnip-field-label-suffix
actioncatnip-field-label-action

See Component API — Test selectors.

Catnip Design System by Signicat