Textarea
A multiline text input with resize control and error state.
Preview
Usage
import { Textarea } from "anexui";
<Textarea placeholder="Write something…" />
Copy codeError state
<Textarea error placeholder="Too short" aria-describedby="ta-err" />
<p id="ta-err">Must be at least 20 characters.</p>
Copy codeResize control
<Textarea resize="none" placeholder="Fixed size" />
<Textarea resize="vertical" placeholder="Vertically resizable (default)" />
<Textarea resize="horizontal" placeholder="Horizontally resizable" />
<Textarea resize="both" placeholder="Both axes" />
Copy codeRows
<Textarea rows={6} placeholder="Taller area" />
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| error | boolean | false | Sets aria-invalid, applies error styling |
| resize | "none" \| "vertical" \| "horizontal" \| "both" | "vertical" | CSS resize behaviour |
| rows | number | — | Visible row count |
| disabled | boolean | false | Disables the textarea |
All standard HTML <textarea> attributes are accepted.
Accessibility
- Native
<textarea>element aria-invalid="true"set automatically whenerroris true- Pair with
aria-describedbypointing to an error message - Always associate with a
<Label>viahtmlFor/id