TextArea Component
A form textarea component that provides a clean and accessible way to collect multi-line user input.
- Accessible textarea implementation
- Support for resizing
- Customizable styling
- Error state handling
- Label integration
- Placeholder support
Installation
The TextArea component is part of our UI library. You can import it directly from the components directory.
Usage
Here is how to use the textarea in your project.
React TSX
React TSX
Examples
Basic TextArea
TextArea with Label
TextArea with Error
Bio is required
API Reference
Textarea
Prop | Type | Default | Description |
---|---|---|---|
value | string | - | The controlled value of the textarea |
defaultValue | string | - | The default value of the textarea |
onChange | (event: React.ChangeEvent<HTMLTextAreaElement>) => void | - | Event handler called when the value changes |
placeholder | string | - | Placeholder text |
disabled | boolean | false | Whether the textarea is disabled |
required | boolean | false | Whether the textarea is required |
name | string | - | The name of the textarea |
id | string | - | The id of the textarea |
className | string | - | Additional CSS classes |
Additionally, all standard HTML textarea attributes are supported.