Textarea
Auto Grow Textarea
A labelled textarea that grows smoothly with its content and counts characters with an animated ring.
npx motionsnack add auto-grow-textareaCustomize
<AutoGrowTextarea />Props
27 properties
| Property | Type | Default | Description |
|---|---|---|---|
| value | string | - | Controlled text. |
| defaultValue | string | '' | Text on first render when uncontrolled. |
| onChange | (value: string) => void | - | Called with the new text on every change. |
| name | string | - | Name of the field in a form. |
| id | string | generated | Id of the textarea. |
| onSubmit | (value: string) => void | - | Called with the text on Cmd/Ctrl+Enter. |
| accent | string | undefined | Colour of the counter ring. Undefined = monochrome. |
| warningColor | string | undefined | Warning colour for both themes. Undefined uses the per-theme pair. |
| errorColor | string | undefined | Error colour for both themes. Undefined uses the per-theme pair. |
| remainingLabel | Partial<Record<Intl.LDMLPluralRule, string>> | { one: '{n} character left', other: '{n} characters left' } | Text read for the characters left. |
| overLimitLabel | Partial<Record<Intl.LDMLPluralRule, string>> | { one: '{n} character too many', other: '{n} characters too many' } | Error text when the limit is passed. |
| locale | string | 'en-US' | Locale for counting and plural rules. |
| duration | number | - | Deprecated: the height changes instantly. |
| className | string | '' | Extra classes on the wrapper. |
| label | string | 'Message' | Label above the field. An empty string hides it. |
| placeholder | string | 'Tell us about your project...' | Placeholder shown while the field is empty. |
| error | string | '' | Error message. Any text switches the field to its error state. |
| helperText | string | 'The field grows as you type.' | Small text under the field. An empty string hides it. |
| minRows | number | 2 | Rows shown while the field is empty. |
| maxRows | number | 6 | Rows the field grows to before it starts to scroll. |
| maxLength | number | 160 | Character limit. 0 removes the limit and the ring. |
| warnAt | number | 0.85 | Share of the limit at which the counter turns to the warning colour. |
| showCounter | boolean | true | Ring and number in the corner of the field. |
| radius | number | 12 | Corner radius of the field. |
| required | boolean | false | Marks the field as required. |
| readOnly | boolean | false | Focusable and selectable, but not editable. |
| disabled | boolean | false | Dims the field and blocks typing. |
About Auto Grow Textarea
Auto Grow Textarea starts at a few rows and eases taller line by line as you type, up to a maximum number of rows, after which it scrolls. Deleting text shrinks it again with the same eased motion. In the corner a ring fills as you approach the character limit while the number ticks over, and both turn to a warning tint near the limit. An accent focus ring fades in around the field when it receives focus. A label and helper text are wired up for assistive technology, and the remaining characters are announced once the warning starts.
What's included
- Height eases between line counts, up to maxRows
- Progress ring and ticking number for the character count
- Warning tint near maxLength, with a live announcement
- Accent focus ring that fades in
- Label and helper text linked to the field
- Controlled or uncontrolled: value, defaultValue, onChange
- Light and dark looks, reduced-motion aware
- Type
- Animated React textarea component
- Library
- Components · Textarea
- Stack
- Next.js, React, Tailwind CSS
- Added
- 2026-09-20
- Install
npx motionsnack add auto-grow-textarea