Label

Accessible caption for a form control

Category: inputs · WCAG 2.2-AA · form, caption, accessibility

States

Props

PropTypeDefaultDescription
htmlForstringId of the form control this label is associated with.
asChildbooleanfalseWhen true, renders the child element as the root via Slot, merging props (polymorphic rendering).
requiredbooleanfalseWhen true, marks the field as required.
disabledbooleanfalseWhen true, disables the control and removes it from the tab order.
childrenReactNodeContent rendered inside the component.
labels{ required?: string }Overrides for the component’s user-visible strings (i18n).

Design tokens

When to use

When not to use

How to build an accessible Label in React →

Examples

Basic

<Label htmlFor="email">Email</Label>

Required

<Label htmlFor="email" required>Email</Label>

asChild

Render the label semantics onto a custom element via Slot.

<Label asChild htmlFor="email"><span>Email</span></Label>

Related components

← Back to docs