# Textarea

A labelled multi-line input with a character count.

[View Textarea on CyberSpec](https://www.cyberspec.dev/components/sidebar/textarea)

## Component

Textarea belongs to the Fields group in the CyberSpec catalog. It uses @ui-sdk/react/textarea, @ui-sdk/react/field.

## Installation

Use a React 19 project with shadcn configured. Render the installed components inside the Cyber root, and import your global stylesheet in the app entry point.

```sh
bunx --bun shadcn@latest add https://www.cyberspec.dev/r/textarea.json
```

## Example

```tsx
"use client"

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

export default function TextareaDemo() {
  return (
    <>
      <Textarea
        label="Job brief"
        maxLength={240}
        defaultValue="Pickup at Cinder Row, dock 4. One sealed Vanta Mk.II deck. Hand it to Mara Voss in Glasswater before 04:00. Don't power it on."
        hint="The runner sees this before accepting."
      />
      <Textarea label="Sign-off" maxLength={32} rows={1} defaultValue="Route cleared. Paid on delivery" />
    </>
  )
}
```

## Install this example

```sh
bunx --bun shadcn@latest add https://www.cyberspec.dev/r/textarea-demo.json
```

## Resources

- [Interactive Textarea preview](https://www.cyberspec.dev/preview/textarea)
- [Component catalog](https://www.cyberspec.dev/components.md)
- [Textarea source code](https://github.com/agnelnieves/cyberspec/blob/main/registry/cyber/ui/textarea.tsx)
- [Shadcn registry item](https://www.cyberspec.dev/r/textarea.json)
