Components › Forms
Textarea counter
A multiline field that shows the character count and enforces a length limit.
Installation
npx plankui@latest add textarea-counterUsage
import { TextareaCounter } from "@/components/ui/textarea-counter";
<TextareaCounter aria-label="Release note" value={note} onChange={(event) => setNote(event.currentTarget.value)} maxLength={120} />API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | Controlled value. Leave it out to let the field keep its own state. | |
| defaultValue | string | "" | Starting text when uncontrolled. |
| onChange | ChangeEventHandler<HTMLTextAreaElement> | Update the value as the user types. | |
| maxLength | number | required | Maximum length, using the browser’s character counting rules. |