Home / Patterns / Inline validation
Forms & input

Inline validation

Field-level feedback shown during or right after input, instead of a single verdict after submit.

States

defaultfocusfilledvalidatingsuccesserrordisabledread-only

Do / Don't

Do
  • Validate on blur, or after the user pauses typing
  • Keep the error message next to the field it belongs to
  • Write errors as "what happened + how to fix it"
  • Preserve the user's input on error, always
Don't
  • Flag an email as invalid while it is still being typed
  • Rely on red color alone to mark errors (WCAG 1.4.1)
  • Show a generic "form contains errors" with no anchors

When to use

Forms with more than ~3 fields, strict formats (email, password rules), or a high cost of abandonment. Skip it for one-field forms where a submit-time check is cheaper and calmer.

Accessibility

Platform notes

On mobile, pair validation with the correct keyboard type (email, numeric) and autocomplete attributes — half of “user errors” in forms are input-mode errors.

Evidence

← All patterns