# Text Input and Textarea

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

- Type: framework
- Domain: Experience & interface
- Level: Foundational
- Last reviewed: 2026-10-07
- Original: [Soroush’s Product Wiki](<https://wiki.soroush.uk/topic/text-input-and-textarea/>)

## What 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.

## Why 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.

## When 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.

## How 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.

## A practical 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.

## Where 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.

## Sources

1. [Text input](<https://design-system.service.gov.uk/components/text-input/>) — GOV.UK Design System · Institutional design system
2. [Textarea](<https://design-system.service.gov.uk/components/textarea/>) — GOV.UK Design System · Institutional design system

## Related topics

- [Form Design](<https://wiki.soroush.uk/topic/form-design/>)
- [Form Validation](<https://wiki.soroush.uk/topic/form-validation/>)
- [Password Input](<https://wiki.soroush.uk/topic/password-input/>)
