Label
Form label with an optional required marker. Renders a real <label>, so
clicking it focuses the control it names.
Props
| Prop | Values | Default | Description |
|---|---|---|---|
required | boolean | false | Shows a danger-coloured asterisk after the text. |
className | string | "" | Appended after the component's own classes. |
All other <label> attributes are forwarded, including htmlFor.
Common patterns
// Explicit association — preferred
<Label htmlFor="email" required>Work email</Label>
<Input id="email" type="email" />
// Implicit — fine for checkboxes and switches
<Label>
<Checkbox /> Remember me
</Label>Notes
The asterisk is aria-hidden, because a screen reader should learn that a
field is required from the required attribute on the input itself, not from
a decorative character in the label. Set both.