Skip to content

Textarea

Multi-line text field that grows with its content.

Browsers
Chrome 123+Firefox 152+
Why this version?

The auto-sized textarea uses CSS field-sizing: content. Older Firefox versions keep the textarea at its fixed size as text is entered.

Safari 26.2+
Why this version?

The auto-sized textarea uses CSS field-sizing: content. Older Safari versions keep the textarea at its fixed size as text is entered.

Tier
0
Bundle compressed
348 B
Forced layout budget
0 ms
Axe budget
0
SSR compatible
Yes
Published contract
Test harness

Playground

Textarea

Default

Autosize

API

Textarea

PropTypeDefaultDescription
valuestring—Current value, making the textarea controlled.
defaultValuestring—Starting value for the uncontrolled textarea, which the native element then owns.
onValueChange(value: string) => void—Called with the new value whenever the textarea changes.
autoSizebooleanfalseGrows the textarea with its content using CSS field-sizing, with no JavaScript involved.
disabledbooleanfalseDisables the native textarea and sets the data-disabled attribute.
readOnlybooleanfalseMakes the value read-only while keeping the textarea focusable.
invalidbooleanfalseMarks the textarea invalid via aria-invalid and the data-invalid attribute.
renderReactElement | ((props, state) => ReactElement)—Replace the rendered element while keeping behavior and accessibility wiring.

Keyboard

KeyAction
TabMove focus to/from the control
Enter / SpaceActivate when focused (button-like controls)

Accessibility

Uses semantic HTML where possible. Inspect rendered markup in the playground — ARIA is added only when native elements are insufficient.

Styling hooks

data-disabled