Label

Form

A form label that associates with an input via the for attribute.

Playground

Controls

Show required asterisk.

Apply disabled/muted style.

Props

PropTypeDefaultDescription
forstringThe id of the input this label is for.
requiredbooleanfalseAppends a red asterisk (*).
disabledbooleanfalseApplies muted/disabled styling.

Examples

Default
vue
<DsLabel>
  Email address
</DsLabel>
Required
vue
<DsLabel required>
  Password
</DsLabel>
Disabled
vue
<DsLabel disabled>
  Unavailable field
</DsLabel>

Accessibility

  • Use the for prop matching the input id to associate the label properly.
  • Screen readers announce the label text when the associated input is focused.