Skip to content

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

PropTypeDefaultDescription
labelstring''Field label
hintstring''Helper text
validationMessagestring''Validation message
validationStatesuccess | warning | error | nonenoneValidation state
requiredbooleanfalseRequired indicator
orientationvertical | horizontalverticalLabel position
sizesmall | medium | largemediumField 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.