error
Description
Optional. Defines whether error styling is applied to the control's labelUsage
error?: boolean;
Parameters
- true - error styling is applied to the control's label
- false - (default) error styling is not applied to the control's label
Example
<Field
label="Text"
error={true}
>
{({ id }) => (
<Text id={id} error />
)}
</Field>
Details
The property is useful during a form validation. If the value of a nested control fails validation and you want to make its label red, set the field's error property to true.
Related article: Styling a validation error
Related sample: Field