Skip to content

Label

Associate a text label with its form control.

alpina-ui/ui/label

Interactive preview

Usage notes

Connect the label to its input with htmlFor and id. Activating the label focuses or activates the associated native control.

When to use

Associate a short, visible name with a specific native control when composing a custom form row.

When to avoid

Use Field when the editor also has hints or errors that need programmatic associations.

Accessibility

Match htmlFor to the control's unique id. Clicking the label should focus or toggle the intended control.

Keys
KeyAction
—Read in document order. The component has no keyboard command of its own.

Content

Name the requested value in a compact noun phrase. Include a unit when two otherwise identical labels could be confused.

Use
Street and house number
Avoid
Type here

Copy in four languages

German
Strasse und Hausnummer22 characters
French
Rue et numéro13 characters
Italian
Via e numero civico19 characters
Romansh
Via e numer da chasa20 characters
Add to your project
npx --no-install alpina add label