Label
FormA form label that associates with an input via the for attribute.
Playground
Controls
Show required asterisk.
Apply disabled/muted style.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
for | string | — | The id of the input this label is for. |
required | boolean | false | Appends a red asterisk (*). |
disabled | boolean | false | Applies 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.
