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.
119

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." />;
}

Installation

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

Usage

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

Field

Use Field, FieldLabel, and FieldDescription to create a textarea with a label and description.

Enter your message below.

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

Disabled

Use the disabled prop to disable the textarea. To style the disabled state, add the data-disabled attribute to the Field component.

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

export function TextareaDisabled() {
  return (
    <Field data-disabled>

Invalid

Use the aria-invalid prop to mark the textarea as invalid. To style the invalid state, add the data-invalid attribute to the Field component.

Please enter a valid message.

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

Button

Pair with Button to create a textarea with a submit 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 RTL support in shadcn/ui, see the RTL configuration guide.

شاركنا أفكارك حول خدمتنا.

"use client";

import * as React from "react";

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