Textarea
Displays a multiline text input field for longer form content.
Installation
pnpm dlx cubix@latest add textarea --base radixUsage
import { Textarea } from "@/components/cubix/textarea"<Textarea placeholder="Type your message here." />Examples
With label and helper text
Your message will be copied to the support thread.
Custom height
Invalid state
Set aria-invalid to switch to destructive border and ring styles � no extra prop needed:
Disabled
In a form
API Reference
Note: The textarea renders data-slot="textarea" for targeting in tests and parent selectors, and switches to destructive styles automatically when aria-invalid is set.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| aria-invalid | boolean | - | Marks the textarea as invalid and applies destructive border/ring styles automatically. |
| disabled | boolean | false | Disables the textarea and prevents interaction. |
| placeholder | string | - | Hint text shown when the textarea is empty (styled with muted-foreground). |
| className | string | - | Additional Tailwind classes merged with the component styles (last one wins). |
| ...props | React.ComponentProps<'textarea'> | - | All native textarea attributes (value, onChange, required, rows, maxLength, ...) are forwarded to the rendered element. |