Label
A form label with an optional marker and a right-aligned slot.
Loading documentation…
Label renders a <label> at 13px medium — the weight the system uses to name
a surface or a group. Inside a Field it wires htmlFor
automatically; standalone you pass htmlFor yourself.
You rarely render it directly. Input, Textarea, NumberField and
OtpField take a label prop and build the whole field, including this.
optional is the inverse of marking everything required with an asterisk: in a
form where most fields are required, the exceptions are the information worth
carrying.
render swaps the element while keeping the typography — useful for a group
heading that labels several controls at once.
The id of the control this labels. Set automatically inside a Field.
Appends a muted "Optional" marker.
A right-aligned slot for a hint, a counter, or a link.
Renders a different element with the same styling.
The label text.