Textarea
Forwards every native textarea attribute while styling minimum height, vertical resizing, focus, and aria-invalid states with neumorphic tokens.
@neumorphism-ui/textareaPreview
Installation
Installation: textarea
npx shadcn@latest add @neumorphism-ui/textareaThe CLI resolves npm dependencies, base tokens, utilities, and component source in order.
New to this Registry? Set up the namespace before continuing.
Usage
Usage: Installation
npx shadcn@latest add @neumorphism-ui/label @neumorphism-ui/textareaImport
Textarea import code
import { Label } from "@/components/ui/label"
import { Textarea } from "@/components/ui/textarea"Example
Textarea usage code
<div className="grid gap-2">
<Label htmlFor="note">Note</Label>
<Textarea
id="note"
name="note"
placeholder="Write a note for your team."
rows={5}
/>
</div>API Reference
| Component | Prop | Type | Default | Description |
|---|---|---|---|---|
Textarea | value / defaultValue | string | — | The controlled text or initial uncontrolled text. |
Textarea | rows | number | — | The initial number of visible rows. |
Textarea | placeholder | string | — | A short example that helps communicate the expected input format. |
Textarea | disabled / required / readOnly | boolean | false | Sets native input constraints. |
Textarea | aria-invalid | boolean | string | — | Enables the error border and focus ring. |
Accessibility
- 01
Connect Label htmlFor to the Textarea id, and do not replace Label with a placeholder.
- 02
When enforcing a character limit, provide maxLength and the current character count, connecting them with aria-describedby when needed.
- 03
Give the error message an id and connect it to the control with aria-invalid and aria-describedby.