# Textarea (/docs/components/textarea)



<ComponentPreview name="textarea-demo" className="[&_.preview>*]:w-full [&_.preview>*]:max-w-64" />

## Overview [#overview]

Use Textarea for multi-line text.

Textareas are useful for comments, descriptions, notes, feedback, support messages, and any field where the answer may be longer than one line.

## Anatomy [#anatomy]

A textarea has a value, placeholder, size, disabled state, and optional validation state. It should usually be wrapped in Field.

## Usage guidance [#usage-guidance]

Use Input for short single-line values. Use Textarea when users need space to write. Set a sensible minimum height so the field does not feel cramped.

## Accessibility [#accessibility]

Always provide a label. Add helper text when users need to know expected length, format, or privacy context.

## Installation [#installation]

<CodeTabs>
  <TabsList>
    <TabsTab value="cli">
      CLI
    </TabsTab>

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

  <TabsPanel value="cli">
    ```bash
    npx love-ui@latest add textarea
    ```
  </TabsPanel>

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

      ```bash
      npm install @base-ui-components/react
      ```

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

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

      <Step>
        Update the import paths to match your project setup.
      </Step>
    </Steps>
  </TabsPanel>
</CodeTabs>

## Usage [#usage]

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

```tsx
<Textarea />
```

## Examples [#examples]

The examples show sizes, disabled state, labels, and form integration.

For accessible labelling and validation, prefer using the `Field` component to wrap textareas. See the related example: [Textarea field](/ui/docs/components/field#textarea-field).

### Small Size [#small-size]

<ComponentPreview name="textarea-sm" className="[&_.preview>*]:w-full [&_.preview>*]:max-w-64" />

### Large Size [#large-size]

<ComponentPreview name="textarea-lg" className="[&_.preview>*]:w-full [&_.preview>*]:max-w-64" />

### Disabled [#disabled]

<ComponentPreview name="textarea-disabled" className="[&_.preview>*]:w-full [&_.preview>*]:max-w-64" />

### With Label [#with-label]

<ComponentPreview name="textarea-with-label" className="[&_.preview>*]:w-full [&_.preview>*]:max-w-64" />

### Form Integration [#form-integration]

<ComponentPreview name="textarea-form" className="[&_.preview>*]:w-full [&_.preview>*]:max-w-64" />
