# Textarea

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

> For the complete documentation index, see [llms.txt](/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](/.well-known/agent-skills/site-skill.md).





<ComponentPreview name="textarea-demo">
  <TextareaDemo />
</ComponentPreview>

## Installation [#installation]

<Tabs defaultValue="cli">
  <TabsList>
    <TabsTrigger value="cli">
      CLI
    </TabsTrigger>

    <TabsTrigger value="manual">
      Manual
    </TabsTrigger>
  </TabsList>

  <TabsContent value="cli">
    ```bash
    npx shadcn@latest add https://shadcn-cssinjs.com/r/textarea.json
    ```
  </TabsContent>

  <TabsContent value="manual">
    <Steps>
      <Step>
        Install the following dependencies:
      </Step>

      ```bash
      pnpm add @stylexjs/stylex
      ```

      <Step>
        Make sure [StyleX is configured](/docs/installation) and the design tokens are
        installed.
      </Step>

      <Step>
        Copy and paste the following code into your project.
      </Step>

      <ComponentSource name="textarea" title="textarea.tsx" />

      <Step>
        Update the import paths to match your project setup.
      </Step>
    </Steps>
  </TabsContent>
</Tabs>

## Usage [#usage]

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

```tsx
<Textarea placeholder="Type your message here." />
```

## Examples [#examples]



### Field [#field]

<ComponentPreview name="textarea-field">
  <TextareaField />
</ComponentPreview>

### Disabled [#disabled]

<ComponentPreview name="textarea-disabled">
  <TextareaDisabled />
</ComponentPreview>

### Invalid [#invalid]

<ComponentPreview name="textarea-invalid">
  <TextareaInvalid />
</ComponentPreview>

### Button [#button]

<ComponentPreview name="textarea-button">
  <TextareaButton />
</ComponentPreview>



## RTL [#rtl]

To enable right-to-left support, see the [RTL guide](/docs/rtl).

<ComponentPreview name="textarea-rtl" direction="rtl">
  <TextareaRtl />
</ComponentPreview>
