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.
What this source can teach
Use this source to compare a documented solution with the task and states in your own product.
- Start with the original. Open the source and find the guidance or example relevant to your task.
- Trace the connection. Use the claim notes below to see how this site applies the source to specific patterns.
- Check the setting. Compare the source's platform, people, and constraints with your own decision.
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. |
Comparisons supported by this source
- Disabled button with no explanation vs inline validation vs error summary
GOV.UK error message guidance supports field-adjacent correction text when a local answer blocks progress.
- Disabled controls without recovery vs disabled button no explanation vs inline validation vs error summary vs permission recovery vs fallback path
GOV.UK error messages support field-level recovery when users can correct a local requirement.
- Inline validation vs error summary
GOV.UK error message guidance documents local field messages, preserved answers, and clear correction wording.
- Validation that clears user input vs inline validation vs error summary vs single-page form vs autosave recovery vs error state
GOV.UK error message guidance supports preserving entered answers and clear field-level correction text.
Evidence Role
This source is treated as pattern-library evidence. Its value comes from the specific claims and setting described above.
Publisher: Government Digital Service. Last checked: .