pattern-library 3 linked patterns checked
GOV.UK Design System: Textarea component
Documents textarea markup with required label, optional hint, rows, spellcheck, disabled state, value, aria-describedby for hint and error text, and specific error message templates for empty, too short, too long, or disallowed-character states.
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 |
|---|---|---|---|
| Character count | Choose character count when the limit is real, useful to users, and enforceable in the same unit displayed by the interface. | The field accepts typing and paste normally; the counter observes length rather than blocking editing prematurely. | GOV.UK textarea guidance separates the underlying multiline field from count and validation text attached to it. |
| Textarea | Choose textarea when the expected response is more than a short single-line answer. | Typing, selection, line breaks, paste, undo, redo, and spellcheck follow native textarea behavior. | GOV.UK textarea guidance supports labels, hints, rows, spellcheck, disabled state, aria-describedby, and specific empty or length errors. |
| 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 textarea guidance supports value, label, hint, error, and length-related validation for multi-line text. |
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: .