---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Textarea

A multi-line field for free words, such as a task's notes, a description, a comment or a message, that grows by rows as a person types, for React and Tailwind CSS. Free, MIT.

Free. Its export: `Textarea`.

## Try it

Type several lines and watch it grow; switch every look, long words, disabled and invalid.

Nothing is sent.

## When to use

- A multi-line field for free words, such as a task's notes, a description, a comment or a message, that grows by rows as a person types.
- Also called: multiline text input.

## Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Textarea on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing.

```sh
npx shadcn@4.23.1 add @goop/meadow-textarea
```

```text
Add the Goop Textarea to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
import { useState } from 'react';
import { Textarea } from '@/components/ui/goop/textarea';

function TaskNotes({ onSave }: { onSave: (notes: string) => void }) {
  const [notes, setNotes] = useState('');
  return (
    <div className="flex flex-col gap-2 w-80">
      <label htmlFor="task-notes" className="text-sm font-medium">
        Notes
      </label>
      <Textarea
        id="task-notes"
        placeholder="Add a note for the crew"
        rows={3}
        value={notes}
        onChange={(event) => setNotes(event.target.value)}
        onBlur={() => onSave(notes)}
      />
    </div>
  );
}

function VisitReport({ report, error }: { report: string; error?: string }) {
  return <Textarea aria-label="Visit report" defaultValue={report} aria-invalid={error ? true : undefined} />;
}

function CrewInstructions() {
  return <Textarea aria-label="Instructions for the crew" counter maxLength={2000} rows={5} />;
}

function DraftMessage() {
  return <Textarea variant="bare" aria-label="Message" defaultValue="Bring gloves on Saturday." />;
}

function TodoCardNotes() {
  return <Textarea variant="dialog" aria-label="Notes" placeholder="Add a note" className="-mx-1" />;
}
```

- Fits: flow (its recipe).
- Its look is its own: a `className` places it (width, margin, flex or grid place), never restyles it; with `counter` it places the field and its count together. An action beside the field is the caller's, in a wrapper element round it.
- width, padding, corner, background, text, motion: add no class for these.

## API reference

### Options

- `variant: default | bare | unstyled | dialog = default`
- `counter?: boolean = false` — Shows the count of characters written against `maxLength` in the field's foot corner; false by default.
- `value?: string`
- `defaultValue?: string`
- `onChange?: (event: ChangeEvent<HTMLTextAreaElement>) => void`
- `name?: string`
- `required?: boolean`
- `disabled?: boolean`
- `form?: string`
- `Defaults: rows = 1`

## Accessibility

- The native element answers the keyboard.
- hover, focus: the browser's own (:hover, :focus): write nothing
- focus-visible: the attribute data-focus-visible
- disabled: the prop disabled
- invalid: the attribute aria-invalid
- placeholder-shown: the prop placeholder

## Motion

- The part sets its own motion: add no transition or animation of your own.

## Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

## Related

- [Search input](/themes/meadow/components/search-input): A search field with the magnifier at its start, for narrowing a list or a page.
- [Password field](/themes/meadow/components/password-field): A field for a password with a button that shows or hides the typed words, for sign-in, sign-up and reset forms.
- [Number input](/themes/meadow/components/number-input): A field for a number, an amount or a quantity, typed in the reader's language or stepped with the arrow keys.
- [Input group](/themes/meadow/components/input-group): A text field with an action joined to it inside its fill.
