# P textarea 11

> Textarea with characters remaining counter

A shadcn/ui block from the [@coss](https://coss.com/ui) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/coss/p-textarea-11).

- Page, with a live preview: https://shadcn.exchange/r/coss/p-textarea-11
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/coss/p-textarea-11-light-f043fae4cadb891f.png
- Registry item: https://coss.com/ui/r/p-textarea-11.json
- Categories: field, textarea
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://coss.com/ui/r/p-textarea-11.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `@coss/field`, `@coss/textarea`

## Files

### `registry/default/particles/p-textarea-11.tsx`

```tsx
"use client";

import { useState } from "react";
import { Field, FieldDescription } from "@/registry/default/ui/field";
import { Textarea } from "@/registry/default/ui/textarea";

export default function Particle() {
  const maxLength = 280;
  const [value, setValue] = useState("");

  return (
    <Field>
      <Textarea
        aria-label="Message"
        maxLength={maxLength}
        onChange={(e) => setValue(e.target.value)}
        placeholder="Type your message here"
        value={value}
      />
      <FieldDescription>
        <span className="tabular-nums">{maxLength - value.length}</span>{" "}
        characters left
      </FieldDescription>
    </Field>
  );
}
```
