Text area
A text area takes an answer longer than a line: notes on a candidate, a message to an employer, the reason for a decision.
How it grows
The area opens 3 lines tall and grows with the text up to 10 lines, then scrolls inside itself. It sizes itself, so it has no resize handle.
Enter starts a new line. When the surface has one main action, Cmd+Enter on a Mac or Ctrl+Enter elsewhere sends it, and the hint names the keys.
- Height at rest
- 3 lines, 84 px
- Height before it scrolls
- 10 lines, 224 px
- Padding
- 12 px
- --space-3
- Text
- 14 px on 20 px, 16 px on 22 px on touch
- --text
Character limits
When an answer has a limit, a count sits at the end of the label row: 412/500.
Let the person write past the limit. The count turns red, an error says how much to remove, and the form waits. Cutting the text at the limit would drop the end of a paste without a word.
512 of 500 characters
- Count
- 11 px, aligned figures, at the end of the label row
- --text-muted
- Count over the limit
- 11 px
- --error
States and accessibility
A text area has the look and the states of the text field: rest, focus, error, read only and disabled.
The count is part of the field's description. A screen reader hears it as 412 of 500 characters when the area takes focus, not on each key.
Permitted and not permitted
Permitted
Let the text run past the limit and say how much to cut
Nothing the person wrote is lost.
Not permitted
A hard limit that cuts pasted text
The end of the paste disappears and nobody is told.