Skip to main content

textarea

Displays a form textarea or a component that looks like a textarea.

Philosophy

When a single line isn't enough, Textarea steps in. It's the same design philosophy as Input - a thin wrapper around the native element with consistent styling. We don't add auto-resize or character counting because those are features you compose on top, not defaults everyone pays for.

Installation


npx @gentleduck/cli add textarea

npx @gentleduck/cli add textarea

Usage

import { Textarea } from '@/components/ui/textarea'
<Textarea />

Examples

Default

Disabled

With Label

With Text

With Button

Form

RTL Support

Set the direction once with DirectionProvider (or <html dir="rtl">) and Textarea follows it. No dir prop needed.

Motion

Use MotionTextarea for a smooth entrance animation powered by motion. The textarea uses a scaleIn entrance (fade, scale, and blur) with a springBouncy transition on mount.

API Reference

PropTypeDefaultDescription
dir'ltr' | 'rtl'-Text direction override. Resolved via useDirection (dir prop -> DirectionProvider -> <html dir>).
classNamestring-Additional CSS class names
...propsReact.HTMLProps<HTMLTextAreaElement>-Additional props to spread to the textarea element

MotionTextarea

scaleIn entrance (fade, scale, and blur) with springBouncy transition on mount. Requires the motion package.

PropTypeDefaultDescription
...propsTextareaProps-All props from Textarea are supported

See also

  • Input - Single-line text input
  • Label - Accessible label for form controls