Forms
Textarea
Multi-line text that grows with its content.
Usage
A native <textarea> that grows with what you type. It uses CSS field-sizing: content where supported and measures the content in JavaScript where it is not. Try typing a few more lines.
Starts at three lines and grows to eight, then scrolls.
When to use
- Multi-line free text: notes, bios, descriptions, messages.
- Text with a limit — turn on
showCountwithmaxLength.
Not for: a single line (use an input) or rich text and formatting (use an editor).
Character counter
showCount adds a live count under the field. With maxLength it reads 42 / 160, turns amber at 90% and red at the limit. The counter is part of the field’s aria-describedby, so it is read when the field is focused rather than on every keystroke.
Shown on your public profile.
States and sizes
Tell us why so we can improve.
Large size.
API
Textarea
| Prop | Type | Default | Description |
|---|---|---|---|
| size | 'sm' | 'md' | 'lg' | 'md' | Text size and horizontal padding: 13 / 14 / 15px. |
| autoGrow | boolean | true | Grow with the content. When off, the box is vertically resizable. |
| rows | number | 3 | Minimum height in lines. |
| maxRows | number | — | Stop growing at this many lines, then scroll. |
| showCount | boolean | false | Show a live character counter. |
| wrapperClassName | string | — | Class for the wrapper that holds the counter. |
| ...props | TextareaHTMLAttributes | — | Forwarded to <textarea>, including ref, value, defaultValue, maxLength, disabled, readOnly. |
In plain HTML: ui-textarea with data-autogrow, optionally ui-textarea-sm or ui-textarea-lg.
Keyboard
| Key | Action |
|---|---|
| Enter | Inserts a new line. |
| Tab | Moves focus out of the field. |
Accessibility
- A native textarea; inside a Field the id, description, invalid and required state are wired automatically.
- maxLength is enforced by the browser, so a screen reader user cannot silently exceed it.
- Counter colours use the warning and destructive text tokens, and the number is always shown.
Motion
- The box follows the text without animating its height, so typing never feels delayed.
- Border, ring and counter colour transition over 150ms. Reduced motion keeps the colour change.