# Textarea

A multi-line text input with a minimum height, focus ring, and disabled state, forwarding every native textarea attribute.

- Category: Forms
- License: MIT
- Page: https://www.saasuji.com/components/textarea
- Install: npx shadcn@latest add https://www.saasuji.com/r/textarea.json

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| rows | `number` | `2` | Native number of visible text rows. |
| placeholder | `string` | — | Hint text shown while the textarea is empty. |
| disabled | `boolean` | `false` | Disables interaction and reduces opacity. |
| readOnly | `boolean` | `false` | Makes the value non-editable while keeping the textarea focusable. |
| value | `string` | — | Controlled value for the textarea. |
| defaultValue | `string` | — | Initial value for an uncontrolled textarea. |
| onChange | `React.ChangeEventHandler<HTMLTextAreaElement>` | — | Called on every keystroke with the change event. |
| className | `string` | — | Additional classes merged onto the textarea. |
| ...props | `React.TextareaHTMLAttributes<HTMLTextAreaElement>` | — | All remaining native textarea attributes (name, id, aria-*, maxLength, …) are forwarded. |

## Source

```tsx
import * as React from "react"
import { cn } from "@/lib/utils"

export type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>;

const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
    ({ className, ...props }, ref) => {
        return (
            <textarea
                className={cn(
                    "flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
                    className
                )}
                ref={ref}
                {...props}
            />
        )
    }
)
Textarea.displayName = "Textarea"

export { Textarea }

```
