frameworkExperience & interface

Text Input and Textarea

Text inputs collect short single-line values, while textareas collect longer free-form text across multiple lines.

Download Markdown (.md)

01What it means

A text input is a form control for a short value such as a name or reference number; a textarea is its multiline counterpart for longer plain text. Both require a persistent label and may include helper text, constraints, validation, and an appropriate input purpose or keyboard hint.[1][2]

02Why it matters

Text entry is flexible but asks users to recall and format information themselves. Choosing the right control, width, keyboard, and guidance reduces ambiguity, formatting errors, and effort across desktop, mobile, and assistive technology.

03When to use it

Use a text input for concise values and a textarea when meaningful answers may span lines. Prefer constrained controls when the valid options are known and manageable, and do not use a large textarea to imply that a long answer is required.

04How it works

  1. Define the expected value, length, sensitivity, format flexibility, and whether multiline input is meaningful.
  2. Choose a single-line input or textarea and size it to suggest a realistic answer rather than an exact limit.
  3. Attach a visible label and place essential format or purpose guidance nearby.
  4. Set appropriate autocomplete and input-mode hints without preventing valid pasted or international input.
  5. Preserve entered text, validate tolerantly, and show any limit or error in text that is programmatically associated with the control.

05A practical example

Example

A support form uses a short text input for an order reference and an expanding textarea for the issue description. The reference accepts pasted separators and the description retains line breaks when validation finds a missing contact method.

06Where it breaks

Free text produces inconsistent data and can demand substantial typing. Browser autofill and mobile keyboards vary, fixed heights can hide content, and strict formatting rules often reject values the system could normalize.

Common mistakes

  • Using a textarea for a short structured value or a single-line input for prose.
  • Using placeholder text as a label or storing critical guidance only inside the empty control.
  • Setting arbitrary character limits without explaining or testing the real content need.
  • Blocking paste, autofill, spaces, or legitimate international characters.

07Sources

  1. Text inputGOV.UK Design System · Institutional design systemText input
  2. TextareaGOV.UK Design System · Institutional design systemTextarea
View saved topics

Start typing to search titles, definitions, categories, and frameworks.