Search

Find a component, token or page

Base · Forms

Textarea

A multi-line text field.

HTML / JSDraftReactStableReact NativeDraftSwift (SwiftUI)PlannedGodotPlannedVueDraftSvelteDraftSolidDraft
Reviewed

Props

tsx
import { Textarea } from "@/components/ui/textarea"

<Textarea placeholder="Add delivery instructions…" />

Overview

Textareas collect longer free-form text such as comments, notes and descriptions. They show several lines at once so people can review what they wrote.

When to use

  • For text that may run past one line: messages, notes, descriptions.
  • Set rows to hint at how much writing is expected.

When not to use

  • For a single short value: use Input.
  • For formatted content (headings, lists, links): use a rich text editor.

Anatomy

  1. Field

    The bordered container. Grows from a minimum height set by rows.

  2. Value or placeholder

    Wraps onto new lines; never scrolls horizontally.

Props

The contract every language implements. Names follow each language’s conventions (camelCase in React, snake_case in Rust).

PropTypeDefaultDescription
placeholderstringAdd delivery instructions…Hint shown while the field is empty.
rowsnumber3Visible lines of text before scrolling.
disabledbooleanfalsePrevents editing and dims the field.
invalidbooleanfalseMarks the value as failing validation.
onChangefunction–Called as the text changes. `onChangeText` in React Native, `oninput` in Dioxus.

States

Rest
Border in color.border.input.
Focus
Border and 3px ring in color.border.focus.
Invalid
Border and ring switch to the danger intent.
Disabled
50% opacity; cannot be focused or edited.

Accessibility

Role: textbox (multiline)

KeysAction
TabMoves focus into and out of the field.
EnterInserts a new line.
  • Always provide a label.
  • If there is a character limit, show the remaining count in text and announce it politely.

Design tokens

Change any of these in Foundations and this component follows, in every language.

Platform notes

HTML / JS
Draft
A native <textarea>; `invalid` is aria-invalid="true". Without a rows attribute it shows three lines.
React
Stable
Matches the contract with no platform differences.
React Native
Draft
TextInput with `multiline`; rows sets the minimum height.
Swift (SwiftUI)
Planned
Not built in Swift yet.
Godot
Planned
Not built in Godot yet.
Vue
Draft
Usage snippet only; same props and behavior as the React component.
Svelte
Draft
Usage snippet only; same props and behavior as the React component.
Solid
Draft
Usage snippet only; same props and behavior as the React component.

Related