Forms
ILabel
The text naming a field. It renders a real <label>, so clicking it focuses the control.
for must match the control's id. Every field component accepts an id prop for exactly this.
Required
required appends an asterisk. It is decorative, so mark the control itself required as well.
When to reach for it
Use ILabel when you are laying a field out by hand. Otherwise let IFormField do it — it renders the label, wires for to a generated id, and links the description, hint and error in one go.
vue
<!-- Preferred: the field owns the label and the wiring. -->
<IFormField name="reference" label="Invoice reference">
<IInput v-model="reference" />
</IFormField>ICheckbox, ISwitch and IRadioGroup items take their own label prop and wire it themselves.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
for | string | — | The id of the control this names |
required | boolean | false | Appends a decorative asterisk |
unstyled | boolean | — | Drop built-in classes |
class | string | — | Merged with the built-in classes |
Reka UI's Label props are forwarded.