Textarea

Displays a multiline text input field for longer form content.

Installation

pnpm dlx cubix@latest add textarea --base radix

Usage

Import
import { Textarea } from "@/components/cubix/textarea"
Example
<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

PropTypeDefaultDescription
aria-invalidboolean-Marks the textarea as invalid and applies destructive border/ring styles automatically.
disabledbooleanfalseDisables the textarea and prevents interaction.
placeholderstring-Hint text shown when the textarea is empty (styled with muted-foreground).
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).
...propsReact.ComponentProps<'textarea'>-All native textarea attributes (value, onChange, required, rows, maxLength, ...) are forwarded to the rendered element.