Skip to main content

Textarea

Multi-line text input for longer content. Supports auto-resize, character counting, and full RTL support with proper text alignment.

Preview

Installation

Terminalbash

Usage

Reacttsx

Examples

With Label

tsx

Custom Height & Resize

tsx

With Character Count

0 / 200

tsx

Disabled and Read-only

tsx

With Validation

tsx

Auto-expanding

Height adjusts automatically as you type

tsx

In Forms

tsx

Props

NameTypeDefaultDescription
placeholder
stringundefinedPlaceholder text shown when textarea is empty
disabled
booleanfalseDisables the textarea
readOnly
booleanfalseMakes the textarea read-only
required
booleanfalseMarks the textarea as required
rows
numberundefinedNumber of visible text rows
maxLength
numberundefinedMaximum number of characters allowed
className
stringundefinedAdditional CSS classes to apply

The Textarea component extends all standard HTML textarea attributes including value, onChange, onBlur, and more.

Accessibility

Always Use Labels

Always pair textareas with labels using the htmlFor attribute. This is essential for screen readers and improves usability.

Placeholder Text

Don't rely solely on placeholder text for instructions. Use labels and helper text. Placeholders disappear when typing.

Error Messages

Associate error messages with textareas using aria-describedby:

tsx

Character Limits

When using maxLength, provide visual feedback about the character count so users know how much space they have.

RTL Considerations

Textareas automatically support RTL text direction. Text alignment and scrollbar position adapt based on the text direction.

LTR (English)

RTL (العربية)

Related Components