Skip to content

Textarea

Stable Available in release assets

Present a native multiline text control while preserving browser-owned editing, validation, submission, scrolling, and resize behavior.

Textarea primary example

Show code
<div class="thin-field">
  <label for="notes">Notes</label>
  <textarea class="thin-textarea" id="notes" name="notes" rows="5" aria-describedby="notes-hint">
  </textarea>
  <small class="thin-hint" id="notes-hint">Add delivery details.</small>
</div>

Each authored example uses the production assets and includes copyable markup.

Anatomy

  • Explicitly associated label
  • Native textarea.thin-textarea
  • Native textarea child with authored name and rows
  • Optional persistent hint
  • Optional server or validation error

Variants and sizes

  • Default — shown above
  • Required — shown above
  • Read-only — shown above
  • Disabled — shown above
  • Fixed authored rows — shown above
  • Application opt-in autogrow enhancement — shown above

Rendered fixtures exercise authored content and constrained layouts with the same production assets.

  • Empty — shown above
  • Populated — shown above
  • Focused — shown above
  • Invalid — shown above
  • Disabled — shown above
  • Read-only — shown above
  • Long unbroken content — shown above
  • Long localized label and hint — shown above
  • Narrow container — shown above
  • 200% and 400% zoom — shown above

Interaction and keyboard behavior

Typing, selection, clipboard commands, undo, scrolling, native constraint validation, form reset, value submission, and user-initiated vertical resizing remain browser owned.

Accessibility

Use an explicit label, retain visible focus, and connect persistent hints and errors with aria-describedby. Do not replace the textarea with contenteditable, suppress native resizing without an equivalent need, or use placeholder text as its accessible name.

Contract
NATIVE
Basis
Native <input>, <select>, and <textarea>; no APG widget
Evidence
  • tests/unit/library/form-controls-stable.test.ts

API

Use <thin-textarea><textarea …></thin-textarea> with an authored name and rows. Native required, minlength, maxlength, readonly, disabled, autocomplete, wrap, and aria-describedby attributes remain the state and submission API.

Behavior tier: native

Structured host, property, and example tables are not authored for this item yet. Use the summary above and the primary example.

Fallback

The native textarea remains resizable, validated, and submitted without CSS or JavaScript.

Assets and dependencies

  • /components.css

Dependencies: None

Source: packages/ui/src/items/textarea/style.ts

Stability evidence

  • Native value, validation, resize, and no-JavaScript contract: test:tests/unit/library/form-inputs.test.ts
  • Complete item-specific API, fallback, and difficult-state documentation: test:tests/unit/release/release-readiness.test.ts
  • Cross-theme, density, localized, narrow-container, zoom, and forced-colors fixture: review:site/src/pages/quality/index.astro#quality-review

Composition

Derived from the examples and style specs, not authored.

Composes