Content
- Name the setting in the label, as a noun: Threshold, Region, SMS alerts.
- Say what the setting does in the help: “Alerts fire when a reading crosses this.”
- Say how to fix it in the error: “Must be between 0 and 100.”
Wraps a control with its label, helper text and error, so every field reads the same.
Turn each piece on and off, and swap the control underneath.
<WildFormField
label="Threshold"
help="Alerts fire when a reading crosses this."
>
<WildTextInput v-model="threshold" />
</WildFormField>hint for a word or two on the label row, such as Optional.A label and optional hint, the control, then help text or an error.
<WildFormField label="Threshold" hint="Optional"
help="Alerts fire when a reading crosses this.">
<WildTextInput v-model="threshold" />
</WildFormField>The error takes the help text’s place, so a field with help keeps its height when validation fires.
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | — | The field’s name. A placeholder isn’t a label. |
| hint | string | — | A short note right of the label. |
| help | string | — | Guidance under the control. |
| error | string | — | Replaces the help while it’s set. |
| required | boolean | false | A red asterisk after the label. |
| Token | Value | Where it lands |
|---|---|---|
| --font-size-sm | 12px | Label. |
| --font-size-xs | 11px | Hint, help and error. |
| --font-weight-medium | 475 | Label. |
| --color-grey-900 | #4F4D55 | Label, hint and help ink. |
| --color-error | #E12121 | Required asterisk and error text. |
| (no token) | 4px | Gap between label, control and message. |