Skip to main content

Text Area

A multi-line plain-text editing control. Pair it with Field to connect its label, description, and errors in a form.

When to use

  • Accept several lines of free-form text, such as a comment on a review or a feedback form.
  • Prefer Input when the text fits on one line.

Appearance

Set appearance="monospaced" to render the text in a fixed-width font.

Validation

Set validation to show the validation status of the text area.

Without a Field

Render the control on its own, and give it an accessible name with aria-label.

Examples

TextArea in a form with client-side validation

In this example, the TextArea is used in a form with client-side validation. The form is built using @tanstack/react-form and zod for validation. The form accepts user feedback and validates the input before submission.

API Reference

TextArea

A multi-line plain-text editing control.

All props from textarea, plus:

PropTypeDefaultDescription
appearance?"monospaced"Defines the visual style of the TextArea.
validation?"error" | "success" | "warning" | false | (() => "error" | "success" | "warning" | false)Use the validation prop to show if the textarea has a specific validation status. This will change the border and outline of the textarea. The false type is useful when using short-circuiting logic so that you don't need to use a ternary with undefined. Setting validation to error also sets aria-invalid.