# TextArea

> A multi-line native text editor.

- Category: [Inputs & forms](https://tarve.dev/docs.md#inputs)
- Import: `import { TextArea } from "@tarve/core";`
- Props type: `TextAreaProps`
- Source: [packages/core/src/components/input.ts:92](https://github.com/omarcosr/tarve/blob/main/packages/core/src/components/input.ts#L92)

## Usage

```tsx title="TextArea.tsx"
import { TextArea } from "@tarve/core";

let notes = "";

<TextArea
  value={notes}
  placeholder="Write something…"
  submitOnEnter={false}
  onChange={(value) => {
    notes = value;
  }}
  style={{ width: 380, height: 160 }}
/>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `autoFocus` | `boolean` | — | Focus the area when it first appears (HTML `autofocus`). |
| `disabled` | `boolean` | — |  |
| `followTail` | `boolean` | — | Keeps the end in view as `value` grows while the area is scrolled to its end, as `<Scroll followTail>`: scrolling up stops it, scrolling back to the end resumes it. |
| `maxLength` | `number` | — | The most characters the user can bring the value to (HTML `maxlength`): typing past it is dropped, a paste is cut to fit. |
| `onChange` | `(value: string) => void` | — |  |
| `onSubmit` | `(value: string) => void` | — |  |
| `placeholder` | `string` | — |  |
| `readOnly` | `boolean` | — | Focusable, selectable, copyable and scrollable, but the user cannot edit it (HTML `readonly`): a log or a preview. The app can still change `value`. |
| `submitOnEnter` | `boolean` | — | When true, Enter submits and Shift+Enter inserts a newline. Ctrl/Cmd+Enter always submits. |
| `value` | `string` | — |  |

## Common props

Shared by every component (descriptions: https://tarve.dev/docs.md#common-props): `children`, `class`, `className`, `highlight`, `id`, `key`, `motionFrom`, `onHighlight`, `onPaste`, `onPointerLeave`, `onPointerMove`, `onSize`, `onTransitionEnd`, `rovingGroup`, `style`.

Previous: [Input](https://tarve.dev/docs/components/Input.md) · Next: [InputGroup](https://tarve.dev/docs/components/InputGroup.md)

---

Tarve v0.13.8 · HTML version: https://tarve.dev/docs/components/TextArea · Index for agents: https://tarve.dev/llms.txt
