Textarea
Textareas collect longer, multi-line responses for messages, notes, descriptions, and feedback. Use them when users need more room than a single-line input provides.
Textarea
Bio is too long.
Features
- Floating labels for compact, readable form layouts.
- Built-in error messaging and invalid state styling.
- Supports native textarea behavior including manual resize.
- Consistent spacing, typography, and semantic token usage.
When to use
Accessibility
Best Practices
Use Clear Labels
Write labels like 'Your message' or 'Project description' so users understand the kind of response expected.
Keep Validation Close
Show validation guidance and errors directly beneath the field so people can correct issues without scanning the page.
Choose Textarea for Longer Content
Use Textarea when users need room for full sentences, notes, or explanations instead of squeezing them into a single line.
Provide Enough Visible Height
Size the field to show enough lines for the expected amount of content so users can review what they have written.
Use Vague Labels
Avoid labels like 'Details' when more specific wording such as 'Shipping instructions' would guide the user better.
Rely on Placeholder Text Alone
Do not place essential instructions only in placeholder text because it disappears once the field has content.
Collapse Long Responses Into a Single Line
Do not force messages, descriptions, or extended responses into a single-line input.
Show Premature Errors
Avoid displaying an error state before the user has had a fair chance to respond unless the flow explicitly requires it.
Make the Field Too Small
Do not size the textarea so tightly that writing or reviewing content becomes difficult.
Props API
| Name | Type | Description |
|---|---|---|
| label | string | Visible floating label and default placeholder text. |
| error | string | Shows validation message and error styles when provided. |
| id | string | Optional explicit ID used to connect the textarea, label, and error message. |
| rows | number | Native textarea sizing control for visible line count when needed. |
| ...props | React.TextareaHTMLAttributes<HTMLTextAreaElement> | Supports native textarea attributes like required, disabled, defaultValue, name, and maxLength. |