pattern-library checked

GOV.UK Design System Error message component

Documents field-adjacent validation messages, preserving entered answers, connecting messages to form controls, and writing clear correction text.

Open source

Pattern Decisions This Source Supports

Pattern Supported decision Required contract Claim note
Disabled button with no explanation Flag this anti-pattern when an unavailable action has no visible requirement, cause, owner, or next step near the control. Users can discover why the action is unavailable without hovering a disabled control or guessing from color alone. GOV.UK error message guidance supports clear field-level requirements and correction text when validation is the better recovery path.
Disabled controls without recovery Flag this anti-pattern when a disabled control blocks a task and the surrounding UI does not provide a reachable next step. Users can discover the cause of unavailability without activating or hovering the disabled control itself. GOV.UK error messages support local correction when disabled controls hide field requirements.
Error state Choose error state when expected content or task progress is blocked by system, network, permission, validation, save, sync, or computation failure. The error remains visible until resolved, intentionally dismissed, replaced by recovered content, or escalated. GOV.UK documents preserving entered answers and writing clear correction text for user-correctable errors.
Error summary Choose an error summary when submit-time validation can leave one or more errors across a page or step. The summary appears after failed submit where keyboard and screen-reader users can perceive it. GOV.UK error message guidance supports the paired field-level messages that remain beside each invalid answer.
Inline validation Choose inline validation when one field has a correctable format, missing-value, range, or requirement problem. The message names the field problem and the correction in plain language. GOV.UK error message guidance places validation messages next to fields, preserves answers, and requires clear correction wording.
Validation that clears user input Flag this anti-pattern when validation failure, failed submit, server rejection, formatting, retry, reload, or route return clears safe user-entered values. Validation messages name the problem and leave the user's value in place for editing. GOV.UK error message guidance supports preserving entered answers while showing clear field-level correction text.

Evidence Role

This source is treated as pattern-library evidence. Use it to validate the decision rules above, not as a visual style reference.

Publisher: Government Digital Service. Last checked: .