Installation
Usage
Props
Sets the id of the textarea. Should match the
htmlFor of the Label component.Sets the name attribute for form submission.
The controlled value of the textarea.
The default value for uncontrolled textareas.
Placeholder text displayed when the textarea is empty.
Disables the textarea, preventing user interaction.
Makes the textarea read-only.
Marks the textarea as required for form validation.
Sets the textarea to an error state with error styling.
Minimum number of rows to display. Controls the initial height.
Maximum number of rows before scrolling. Controls how tall the textarea can grow.
Controls whether users can manually resize the textarea. Only supports vertical resizing.
Add an icon or element to the left of the textarea.
Add an icon or element to the right of the textarea.
Visual style variant. Use
inverse for dark backgrounds.Callback fired when the textarea value changes.
Overrides the default element name for customization.
Examples
With Character Count
With Error State
With Custom Height
Accessibility
- Always pair Textarea with a Label using matching
idandhtmlForprops - Use
requiredprop and RequiredDot in Label for required fields - Provide character count feedback with HelpText
- Use
aria-describedbyto associate help text or error messages - Ensure the textarea is keyboard accessible
- The component automatically grows with content for better UX
Best Practices
- Use for multi-line text input like comments, descriptions, or messages
- Provide character limits with visible counters when applicable
- Set appropriate
minRowsbased on expected input length - Use
maxRowsto prevent the textarea from becoming too tall - Show clear validation errors with actionable messages
- Consider using resize=“vertical” for user control when needed
- Keep placeholder text concise and example-based