Field
FuiField wraps a form control with a label, hint text, and validation message. When validationState is set to 'error', child components automatically reflect the invalid state without requiring the invalid prop.
Basic usage
Choose a unique username
Validation states
Looks good!
This might be an issue
This field is required
Required
Orientation
Label is on the left
Label is on top
Context bridging — auto invalid
This field is required
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | '' | Field label |
| hint | string | '' | Helper text |
| validationMessage | string | '' | Validation message |
| validationState | success | warning | error | none | none | Validation state |
| required | boolean | false | Required indicator |
| orientation | vertical | horizontal | vertical | Label position |
| size | small | medium | large | medium | Field size |
Context bridging
When a child form component (FuiInput, FuiTextarea, FuiCheckbox, FuiSelect, FuiCombobox, FuiRadio, FuiSwitch, FuiSlider, FuiSpinButton, FuiRating, FuiSearchBox) is placed inside FuiField, it automatically receives the validationState via provide/inject. If validationState is 'error', the child applies its invalid visual styling and sets aria-invalid="true", with no need to pass invalid manually.
The invalid prop on the child still takes precedence when explicitly set.