Design System
Forms

Textarea

Multi-line input for longer, free-form responses such as claim notes or supporting detail.

Purpose

Use a Textarea when the answer runs to a sentence or more. For short, single-line answers use Input.

Example

States

Six states cover the lifecycle. Focus is shown with its styles applied for illustration.

Add a short note explaining the claim.

Rows

Textarea is a styled native <textarea>, so the native rows attribute sets the visible height. The control never shrinks below its 80px minimum (min-h-20), so rows values under three have no effect; larger values make room for longer answers up front. The native corner resize handle is kept, so users can drag the field taller themselves.

Structure

The tokens behind the control — change these, and every textarea follows.

PropertyValue
Min height80px (min-h-20), grows with rows
Padding12px horizontal, 8px vertical (px-3 py-2)
Typography14px (text-sm); placeholder --muted-foreground
Border1px --input
Radius--radius-md (6px)
Shadow--shadow-1
Focusborder --ring + 2px --ring at 40%
Errorborder --destructive + ring at 30% (via aria-invalid)
Disabled50% opacity, --muted fill, not-allowed cursor

Best practices

Do

  • Keep the label visible — pair every Textarea with a Label or wrap it in Field.
  • Size the field to the expected answer with rows — a cramped box invites cramped answers.
  • Put length or format guidance in the hint, not the placeholder.
  • Show a character count when a hard limit applies, and validate on blur or submit.

Don't

  • Use a Textarea for short, single-line answers — that is Input's job.
  • Rely on colour alone for errors — always pair the red border with a message.
  • Disable paste — long-form answers are often drafted elsewhere.
  • Trap Enter for form submission — inside a textarea, Enter must insert a newline.

Accessibility & keyboard

Field does the wiring; these are the guarantees the pattern gives you.

  • Label and control are linked with htmlFor; hint and error are announced via aria-describedby.
  • Errors set aria-invalid, which drives the destructive border and ring — colour is always paired with a written message.
  • Focus shows a 2px --ring outline — never remove it.
  • Keyboard: Tab / Shift+Tab move between fields; Enter inserts a newline rather than submitting; standard text editing inside.

Props

Textarea is a styled native <textarea> — it accepts every native attribute (rows, maxLength, autoComplete…) and adds nothing on top.

No public props found for TextareaProps.

On this page