Forms
Textarea
A multi-line text control for longer input.
Shown on the changelog after you publish.
Installation
Copy the source with the CLI to own and edit it, or import it from the npm package.
npx aback-ui@latest add textareaWrites components/ui/textarea.tsx. First time in this project? Run npx aback-ui@latest init first, as the installation guide shows.
Usage
Import the parts you need from the installed file. The Code tab above has a complete, working example.
import { Textarea, textareaClassName } from "@/components/ui/textarea";API reference
Props and composition points for Textarea. Native element props pass through.
| Prop | Type | Default | Description |
|---|---|---|---|
rows | number | None | Initial visible height. The control still resizes vertically. |
aria-invalid | boolean | "true" | "false" | None | Turns the border destructive and pairs with a Field error. |
disabled | boolean | None | Prevents interaction and reduces opacity. |
className | string | None | Width and minimum height adjustments. |
Dependencies: no extra packages, plus the shared @/lib/utils helper.
Accessibility
Semantics, keyboard behavior, and the decisions that keep the component operable.
- Pair with a visible Label or Field, and associate descriptions and errors with aria-describedby.
- The control resizes vertically only, so horizontal layout is never broken.
- Use font-mono only when the content is code or data, not for ordinary prose.
- Set a sensible maxLength and show a remaining character count when the limit matters.
Used in production
The Aback products whose interfaces shaped this component.