# Spill Textarea

A textarea with a character limit. A ring fills as you write and turns amber near the end; past the limit each new letter blushes red, tips over and falls out of the field, leaving an empty gap where it was, or stays red while a copy of it falls.

- Page and source: https://uibrik.com/components/spill-textarea
- Install: `npx shadcn@latest add https://uibrik.com/r/spill-textarea.json`
- Packages (installed by the CLI): motion
- Import: `import { SpillTextarea } from "@/components/uibrik/spill-textarea/spill-textarea"`

Where to use the Spill Textarea React component:

- **Post composers**: Short-form posts and replies show their limit without a wall of numbers. Pairs with [Prompt Input](https://uibrik.com/components/prompt-input).
- **Bios and descriptions**: Profile and listing fields make going over obvious before the save fails. Pairs with [Settings Page](https://uibrik.com/components/settings-page).
- **SMS and push copy**: Message writers see exactly which characters won't fit.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| limit | `number` | `80` | Characters allowed before letters fall. |
| overflow | `"fall" \| "copy"` | `"fall"` | What happens to a letter typed past the limit. |
| gravity | `number` | `1` | How hard letters fall. |
| warnAt | `number` | `0.8` | Share of the limit at which the ring turns amber. |
| countFrom | `number` | `20` | Remaining characters at which the number appears. |
| color | `string` | `"#ef4444"` | Colour of over-limit letters. |
| warnColor | `string` | `"#f59e0b"` | Ring colour near the limit. |
| radius | `number` | `16` | Corner radius. |
| value | `string` |  | Controlled value. |
| defaultValue | `string` | `""` | Starting text when uncontrolled. |
| onChange | `(value: string, over: boolean) => void` |  | Called with the text and whether it is over the limit. |
| placeholder | `string` | `"What's happening?"` | Placeholder text. |
| label | `string` | `"Message"` | Accessible name for the field. |
| minRows | `number` | `3` | Rows shown when empty. |
| maxRows | `number` | `8` | Rows it grows to before scrolling. |
| className | `string` |  | Classes for the wrapper. |
