About the shadcn/ui Textarea Component

The Textarea component is part of shadcn/ui — a collection of accessible, copy-paste React components built with Radix UI and Tailwind CSS. Install it with `npx shadcn@latest add textarea` and copy it directly into your project.

Textarea Component — Frequently Asked Questions

How do I make a shadcn Textarea auto-resize as the user types?

Listen to `onChange` and set height: `e.target.style.height = 'auto'; e.target.style.height = e.target.scrollHeight + 'px'`. Or use a library like `react-textarea-autosize`.

How do I add a character counter to a shadcn Textarea?

Track length in state: `onChange={(e) => { setValue(e.target.value); setCount(e.target.value.length) }}`. Render `{count}/500` below the textarea.

How do I use shadcn Textarea with React Hook Form?

Spread register result: `<Textarea {...register('message', { required: true, maxLength: 500 })} />`. The Form example shows full validation setup.