pattern-library 2 linked patterns checked
GOV.UK Design System: Text input component
Documents single-line text input markup with required label, optional hint, error message, aria-describedby wiring, autocomplete attributes for input purpose, and prefix or suffix options.
Read with a purpose
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 |
|---|---|---|---|
| Text input | Choose text input when the user enters a short freeform value such as a reference, title, identifier, one-line note, or organization name. | Typing, deleting, selection, undo, and paste operate like a native single-line text field. | GOV.UK text input guidance supports persistent labels, hints, error messages, aria-describedby wiring, autocomplete attributes, and input width variants. |
| 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 text input guidance supports value, label, hint, error, and described-by wiring for preserving and correcting field input. |
Comparisons supported by this source
- Text input vs autocomplete vs select vs radio group
GOV.UK documents required labels, hints, errors, aria-describedby, autocomplete attributes, and text input markup.
Evidence Role
This source is treated as pattern-library evidence. Its value comes from the specific claims and setting described above.
Publisher: GOV.UK Design System. Last checked: .