🚀ReacUI is currently in Beta. We're actively improving it! ❣️
Textarea
A multi-line text input component for capturing longer form text
Installation
The Textarea component is part of the ReacUI library. Install the package to use it in your project.
Import
Import the Textarea component into your React component.
Basic Usage
The Textarea component provides a styled multi-line text input.
Textarea Sizes
Control the size of the textarea by adjusting the number of rows.
Textarea States
Textareas can be in different states such as default, disabled, or with validation states.
This field is required
With Character Count
Add a character counter to help users stay within character limits.
0 / 200
API Reference
The following props are available for the Textarea component.
| Prop | Type | Default | Description |
|---|---|---|---|
| id | string | - | The id attribute of the textarea element |
| name | string | - | The name attribute of the textarea element |
| rows | number | 3 | Number of rows in the textarea |
| placeholder | string | - | Placeholder text displayed when the textarea is empty |
| value | string | - | The controlled value of the textarea |
| defaultValue | string | - | The initial value of the textarea |
| disabled | boolean | false | Whether the textarea is disabled |
| state | enum | 'default' | The validation state: 'default', 'valid', or 'error' |
| maxLength | number | - | Maximum number of characters allowed |
| showCount | boolean | false | Whether to show the character count when maxLength is set |
| onChange | function | - | Callback function triggered when the textarea value changes |