Different UI patterns for displaying form validation errors. Choose the pattern that best fits your UX requirements.
1. Inline Field Errors
The most common pattern. Error messages appear directly below each field. Best for forms where users need immediate field-level feedback.
pa-form-group--error to the form group and pa-form-help--error to the help text.
2. Summary Block (Top of Form)
All errors collected in a single alert at the top. Good for accessibility and giving users a quick overview of all issues.
3. Combined: Summary + Inline (Recommended)
The best of both worlds. Summary for overview, inline for specific guidance. Most accessible approach.
4. Border + Icon Only (Minimal)
Space-efficient but less informative. Red border and icon indicate error without text message. User must infer the issue or hover/click for details.
5. Right-side Indicators
Error text positioned to the right of the input. Works well in horizontal form layouts with more screen real estate.
6. Helper Text Transforms to Error
Helper text below the field transforms into error text when validation fails. Maintains consistent spacing.
7. Toast Notifications
Validation errors shown as toast notifications. Best for submit-level errors or async validation (e.g., server-side checks).
Toast preview (normally appears in corner):
Invalid credentials. Please check your email and password.
8. Validation Timing Strategies
When to trigger validation affects user experience significantly.
On Input (Real-time)
Validates as user types. Can feel aggressive.
On Blur (Recommended)
Validates when field loses focus. Good balance.
On Submit
All errors shown at once on submit. Traditional approach.
9. Multi-field / Cross-field Validation
When validation depends on multiple fields (e.g., password confirmation, date ranges).
10. Progressive Validation (Multi-step Forms)
Validate each step before allowing progression. Prevents users from reaching the end with invalid data.
Account
Profile
Confirm
CSS Classes Reference
Form Group States
pa-form-group--success- Success state (green)pa-form-group--warning- Warning state (yellow/orange)pa-form-group--error- Error state (red)
Input States
pa-input--success- Success border on inputpa-input--warning- Warning border on inputpa-input--error- Error border on input
Help/Message Text
pa-form-help- Base help text stylingpa-form-help--success- Green help textpa-form-help--warning- Yellow/orange help textpa-form-help--error- Red help text
Alert Variants (for Summary Blocks)
pa-alert pa-alert--danger- Error summary blockpa-alert pa-alert--warning- Warning summary blockpa-alert pa-alert--success- Success message blockpa-alert pa-alert--info- Info message block
Text Utility Classes
text-danger- Red text colortext-warning- Yellow/orange text colortext-success- Green text colortext-muted- Muted/gray text color