Textarea
Room for more than a line. It grows with what people write, up to the height you allow.
When to use it
Use Textarea for descriptions, comments, and notes, anything people might write a few sentences in. It starts 64px tall, so it looks like room to write.
Cap its growth with a max height when it sits in a dense layout, so a long note canโt push the rest of the page away.
Input
One line.
Profile
The name shown in your workspace.
Used for account notifications.
Names, emails, and other short answers.
TextareaThis page
Several lines.
Descriptions, comments, and notes.
How it behaves
Renders a native textarea and forwards every textarea prop. Label it and connect hints or errors using aria-describedby.
It grows with its content using field-sizing: content, starting at 64px, and has no resize handle. Add a max-h class to cap the growth; past it, the text scrolls. Browsers without field-sizing keep the minimum height and scroll.
Matches Input: a filled control surface, a faint edge on hover, and a 2px focus ring. Set aria-invalid for invalid values; validation belongs to your form.
Build it
Add it with the shadcn CLI:
1pnpm dlx shadcn@latest add https://jzbui.com/r/textarea.jsonA complete example. Change the values to fit your product:
12345678910import { Textarea } from "@/components/ui/textarea"
<label htmlFor="description" className="label-md">Description</label><Textarea id="description" name="description" placeholder="What is this project about?" aria-describedby="description-hint"/><p id="description-hint" className="caption text-muted-foreground">Shown on the project overview.</p>The full source is yours to edit once installed: