For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
43
Sponsor

Textarea

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

import { Textarea } from "@/components/ui/textarea";

export function TextareaDemo() {
  return (
    <Textarea placeholder="Type your message here." style={{ maxWidth: 320 }} />
  );

Installation

$ pnpm dlx shadcn@latest add https://shadcn-cssinjs.com/r/textarea.json

Usage

import { Textarea } from "@/components/ui/textarea/textarea";
<Textarea placeholder="Type your message here." />

Examples

Field

Enter your message below.

import {
  Field,
  FieldDescription,
  FieldLabel,
} from "@/components/ui/field";
import { Textarea } from "@/components/ui/textarea";

Disabled

import { Textarea } from "@/components/ui/textarea";

export function TextareaDisabled() {
  return <Textarea disabled placeholder="Type your message here." />;
}

Invalid

import { Textarea } from "@/components/ui/textarea";

export function TextareaInvalid() {
  return <Textarea aria-invalid placeholder="Type your message here." />;
}

Button

import { Button } from "@/components/ui/button";
import { Textarea } from "@/components/ui/textarea";

export function TextareaButton() {
  return (
    <div className="grid w-full gap-2">

RTL

To enable right-to-left support, see the RTL guide.

"use client";

import { useTranslation } from "@/components/language-selector";
import type { Translations } from "@/components/language-selector";
import { Textarea } from "@/components/ui/textarea";