# Textarea: Character count

> With `maxLength` inside a `Field`, `FieldCounter` counts as you type and nudges when you hit the limit.

Example: https://hextaui.com/docs/textarea/examples/counter
Component docs: https://hextaui.com/docs/textarea.md

## Add this example

```bash
npx shadcn@latest add https://hextaui.com/r/textarea-counter.json
```

This adds `components/examples/textarea/counter.tsx` with the Textarea component and the HextaUI theme tokens.

## Source

```tsx title="components/examples/textarea/counter.tsx"
import { Field, FieldCounter, FieldLabel } from "@/components/ui/field"
import { Textarea } from "@/components/ui/textarea"

export function TextareaCounter() {
  return (
    <Field className="w-full max-w-sm">
      <div className="flex items-baseline justify-between gap-3">
        <FieldLabel>Bio</FieldLabel>
        <FieldCounter />
      </div>
      <Textarea name="bio" maxLength={160} minRows={2} />
    </Field>
  )
}
```

## Props in this example

### Textarea

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `minRows` | `number` | `3` |  |

## More Textarea examples

- [Send with a shortcut](https://hextaui.com/docs/textarea/examples/submit.md)
- [Rows](https://hextaui.com/docs/textarea/examples/rows.md)
- [Fixed size](https://hextaui.com/docs/textarea/examples/fixed.md)
- [States](https://hextaui.com/docs/textarea/examples/states.md)
- [Right to left](https://hextaui.com/docs/textarea/examples/rtl.md)
