Textarea
Multi-line text field that grows with its content.
- Browsers
- Chrome 123+Firefox 152+Why this version?Safari 26.2+
The auto-sized textarea uses CSS
field-sizing: content. Older Firefox versions keep the textarea at its fixed size as text is entered.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
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Current value, making the textarea controlled. |
defaultValue | string | — | 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. |
autoSize | boolean | false | Grows the textarea with its content using CSS field-sizing, with no JavaScript involved. |
disabled | boolean | false | Disables the native textarea and sets the data-disabled attribute. |
readOnly | boolean | false | Makes the value read-only while keeping the textarea focusable. |
invalid | boolean | false | Marks the textarea invalid via aria-invalid and the data-invalid attribute. |
render | ReactElement | ((props, state) => ReactElement) | — | Replace the rendered element while keeping behavior and accessibility wiring. |
Keyboard
| Key | Action |
|---|---|
| Tab | Move focus to/from the control |
| Enter / Space | Activate 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