Textarea
A soft, roomy field that grows with its text, and a mochi who keeps you company. She dozes behind the top edge, pops up with a "!" when you focus the field, follows the caret with her eyes and beams while you type. Every keystroke kicks a sparkle off the caret, a new line drops a heart, and deleting leaves a little puff.
Installation
❯ npx shadcn@latest add https://yan.moe/r/textarea.jsonUsage
import { Textarea } from "@/components/ui/textarea"<Textarea placeholder="Tell us everything" />For other bursts, pass a recipe from Effects:
<Textarea fx={{ ...fxRecipes.hearts, count: 2 }} />. Keep count low: it fires on every keystroke.
In kawaii mode the field sits in a full-width wrapper that holds the mochi, and
className still goes to the field. The mochi stands about 28px above the top
edge, so leave that much room over the field.
Accessibility
- It renders a native
<textarea>. Name it with aLabel. - Text is 16px below the
smbreakpoint, so iOS does not zoom the page on focus. - Growing with the text uses
field-sizing: content. Browsers without it show a fixed-height field that scrolls. - The mochi is decoration: hidden from screen readers and out of the pointer's way.
- With
prefers-reduced-motion: reduce, she pops up without the bounce, and no particles are drawn.
API
| Prop | Type | Default |
|---|---|---|
intensitykawaii: the mochi, sparkles off the caret, a heart on a new line, a puff on delete. subtle and off: only the focus ring. | "kawaii" | "subtle" | "off" | "kawaii" |
fxOverrides for the per-keystroke burst. | BurstOptions | - |