# Text Area

Multi-line text editor with word wrap



<ComponentPreview base="ink" name="text-area-demo" />

Installation [#installation]

<CodeTabs>
  <TabsList>
    <TabsTrigger value="cli">
      Command
    </TabsTrigger>

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

  <TabsContent value="cli">
    ```bash
    npx shadcn@latest add @termcn/text-area
    ```
  </TabsContent>

  <TabsContent value="manual">
    <Steps>
      <Step>
        Copy and paste the following code into your project.
      </Step>

      <ComponentSource base="ink" name="text-area" title="components/ui/text-area.tsx" />

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

Usage [#usage]

```tsx
import { TextArea } from "@/components/ui/text-area";
```

```tsx
<TextArea
  label="Description"
  placeholder="Enter a description..."
  rows={4}
  onSubmit={(value) => console.log("Submitted:", value)}
/>
```

API Reference [#api-reference]

TextArea [#textarea]

| Prop          | Type                                                                                         | Default   |
| ------------- | -------------------------------------------------------------------------------------------- | --------- |
| `value`       | `string`                                                                                     | -         |
| `onChange`    | `(value: string) => void`                                                                    | -         |
| `onSubmit`    | `(value: string) => void`                                                                    | -         |
| `placeholder` | `string`                                                                                     | `""`      |
| `rows`        | `number`                                                                                     | `4`       |
| `label`       | `string`                                                                                     | -         |
| `id`          | `string`                                                                                     | -         |
| `borderStyle` | `"single" \| "double" \| "round" \| "bold" \| "singleDouble" \| "doubleSingle" \| "classic"` | `"round"` |
| `paddingX`    | `number`                                                                                     | `1`       |
| `cursor`      | `string`                                                                                     | `"█"`     |
