Introducing PrimeReact v11-alpha 🎉Discover Now
styledForm

Textarea

Textarea is a multi-line text input element.

preview

Usage#

import { Textarea } from '@primereact/ui/textarea';
<Textarea />

Examples#

Basic#

A multi-line input for capturing longer free-form text content.

basic-demo

Auto Resize#

Textarea can automatically adjust its height based on the content by setting the autoResize property.

auto-resize-demo

Float Label#

A floating label appears on top of the input field when focused. Visit FloatLabel documentation for more information.

float-label-demo

Ifta Label#

IftaLabel is used to create infield top aligned labels. Visit IftaLabel documentation for more information.

ifta-label-demo

Sizes#

Textarea provides small and large sizes as alternatives to the base by setting the size property.

sizes-demo

Filled#

Specify the variant property as filled to display the component with a higher visual emphasis than the default outlined style.

filled-demo

Invalid#

Invalid state is displayed using the invalid prop to indicate a failed validation. This style is useful when integrating with form validation libraries.

invalid-demo

Disabled#

When disabled is present, the element cannot be edited and focused.

disabled-demo

API#

Sub-Components#

See Primitive API for Textarea component documentation.

Hooks#

See Headless API for useTextarea hook documentation.

Accessibility#

See Textarea Primitive for WAI-ARIA compliance details and keyboard support.