Textarea
Multi-line text input for longer content. Supports labels, hints, validation states, and resizing.
Default
A basic textarea with label, hint text, and required indicator.
Default Textarea
This is a hint text to help user.
Disabled
A disabled textarea that cannot be interacted with. Resizing is also disabled.
Disabled
Invalid / Error
Pass an error prop to show validation state with a red border and error message.
Error State
This field is required.
Usage
Import the Textarea component and configure with props.
tsx
import { Textarea } from "@/components/ui/Textarea";
// Basic
<Textarea
label="Description"
placeholder="Enter a description..."
rows={5}
/>
// Required with hint
<Textarea
isRequired
label="Description"
hint="This is a hint text to help user."
placeholder="This is a placeholder."
rows={5}
/>
// Error state
<Textarea
isRequired
label="Description"
error="This field is required."
rows={5}
/>
// Disabled
<Textarea
label="Description"
placeholder="Disabled textarea"
rows={5}
disabled
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | — | Label text above the textarea. |
| error | string | — | Error message. Replaces hint when present. |
| hint | string | — | Helper/hint text below the textarea. |
| helperText | string | — | Alias for hint (backward compatible). |
| isRequired | boolean | false | Show required asterisk on label. |
| disabled | boolean | false | Disable the textarea. |
| rows | number | — | Number of visible text rows. |
| placeholder | string | — | Placeholder text. |
| wrapperClassName | string | — | Additional CSS class for the wrapper. |