Skip to content
Protocore Design Systemv1.6.9

/// Inputs

Textarea

Sunken multi-line text control, with an opt-in auto-resize that grows the field to fit its content.

import { Textarea } from "@protocore/pds";
View as Markdown

Basics

A multi-line sibling of Input for longer free text — descriptions, notes, incident reports. rows sets the initial height; the field scrolls once content overflows.

Auto-resize

Set autoResize to grow the field with its content instead of scrolling. rows becomes the minimum height. Works with both controlled and uncontrolled values.

States

invalid paints the danger border and sets aria-invalid; native disabled mutes the control. Pair invalid with a Field error for the explanation.

When to use

Use Textarea whenever the input is more than a single line — commit messages, runbook notes, descriptions. Wrap it in a Field for the label and hint.

  • Turn on autoResize for composer-style inputs where a scrollbar would feel cramped; leave it off for fixed-height slots in dense forms.
  • For a single line of text, use Input instead — a one-row Textarea just invites accidental newlines.
  • For structured or code content, consider a dedicated editor rather than a raw Textarea.

Do & don't

Do

  • Use Textarea for genuinely multi-line input.
  • Enable autoResize for composers and note fields so content stays visible.
  • Set a sensible rows minimum so the field doesn't start as a sliver.
  • Wrap it in a Field for its label, hint, and error wiring.

Don't

  • Don't use a one-row Textarea where an Input belongs.
  • Don't combine autoResize with a fixed height style — they fight.
  • Don't rely on the red border alone for invalid; add a Field error.
  • Don't drop the label; a bare Textarea is unnamed to assistive tech.

Accessibility

  • Renders a native `<textarea>`; label it via Field or a wrapping `<label>`.
  • `invalid` sets `aria-invalid`; pair it with Field's `error` text.
  • `autoResize` is a visual convenience only — it doesn't change semantics or value.
  • Respects the shared focus ring and accent focus border like every control.

Textarea props

PropTypeDefaultDescription
autoResizebooleanGrow the field to fit its content instead of scrolling. Respects `rows` as the minimum.
classNamestring
invalidbooleanMark the field invalid — danger border plus `aria-invalid`.
sizeenummdControl padding scale: `sm` · `md` (default) · `lg`.
styleCSSProperties

Related

  • InputThe base single-line text control — a sunken field with optional leading and trailing adornment slots.
  • FieldForm-field wrapper: a caption label, the control, and hint or error messaging with ARIA wired for you.
  • SearchInputAn Input specialised for queries — leading magnifier, sunken field, and a clear button once text is present.
  • NumberInputNumeric field with a mono tabular value and a hairline stepper column — clamps to min/max and steps with the arrow keys.