Textarea

A multi-line text input for comments, descriptions and messages. Inside a Field it picks up its id, description, error and required state.

StableSource

Import

tsx
import { Textarea } from "@merid/react";

Examples

Resize

The handle defaults to vertical. Use none when the layout must not change, both rarely.

Invalid and disabled

Controlled with a counter

0 / 140

API reference

Textarea forwards its ref to the <textarea> and passes every other native attribute through.

PropTypeDefaultDescription
resize"none" | "vertical" | "both""vertical"User resize handle.
invalidboolean–Forces the invalid style (`data-invalid`) and `aria-invalid`. Inside a Field, derived from its error.
rowsnumber4Visible text lines (native).

Styling

HookValues
.mrd-textareaThe <textarea>
data-resizenone · vertical · both
data-invalidPresent when invalid; drives the danger border (aria-invalid carries the semantics)

Textarea shares the Input styles in input.css; it has no size variants.

Accessibility

  • Give it a visible label through Field or Label.
  • If you show a character counter, keep maxLength and the visible count in sync; consider linking the counter with aria-describedby.
KeyAction
TabMoves focus to the textarea.
EnterInserts a line break (it does not submit the form).

Guidelines

Do

Size rows to the expected answer length so people know how much to write.

Avoid

Use a Textarea for single-line values like names or emails.

  • Input — single-line text.
  • Field — label, description and error wiring.