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'
import { Textarea } from '@/components/ui/textarea'
<Textarea />
<Textarea />

Examples

Default

Disabled

With Label

With Text

With Button

Form

API Reference

Textarea

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

RTL Support

Direction is resolved through the shared primitives direction module. Use a local dir="rtl" override when the component exposes it, or set DirectionProvider at app/root level for global RTL/LTR behavior.

See also

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