ui-kit0.0

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 showCount with maxLength.

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.

59 / 160

Shown on your public profile.

States and sizes

Large size.

API

Textarea

PropTypeDefaultDescription
size'sm' | 'md' | 'lg''md'Text size and horizontal padding: 13 / 14 / 15px.
autoGrowbooleantrueGrow with the content. When off, the box is vertically resizable.
rowsnumber3Minimum height in lines.
maxRowsnumber—Stop growing at this many lines, then scroll.
showCountbooleanfalseShow a live character counter.
wrapperClassNamestring—Class for the wrapper that holds the counter.
...propsTextareaHTMLAttributes—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

KeyAction
EnterInserts a new line.
TabMoves 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.