Skip to main content

Textarea

Textarea is a multiline text input component with size variants, visual styles, and configurable resize behavior.

Open in Storybook

Import​

import { Textarea } from "@tosui/react";

Basic usage​

Sizes​

Variants​

States​

Rows​

Control the initial height with the rows prop.

Resize behavior​

Control how the textarea can be resized.

With FormField​

Use with FormField for labels and validation messages.

<FormField
label="Bio"
helperText="Tell us about yourself"
>
<Textarea rows={4} placeholder="Your bio..." />
</FormField>

<FormField
label="Message"
errorMessage="Message is required"
isInvalid
isRequired
>
<Textarea placeholder="Enter your message" />
</FormField>

Props reference​

PropTypeDefaultDescription
size"sm" | "md" | "lg""md"Textarea size
variant"outline" | "filled""outline"Visual variant
disabledbooleanfalseDisable the textarea
isInvalidbooleanfalseShow invalid state
rowsnumber3Number of visible rows
resize"none" | "vertical" | "horizontal" | "both""vertical"Resize behavior

Textarea also accepts all native <textarea> attributes and Box styling props.

TypeScript​

import { Textarea, type TextareaSize, type TextareaVariant, type TextareaResize, type TextareaProps, type TextareaOwnProps } from "@tosui/react";