Textarea
A multi-line textarea with spring auto-resize height, a glow focus variant, a live character counter, and invalid shake.
Customize
Installation
npx shadcn@latest add @kinetic/textareaUsage
import { Textarea } from "@/components/kinetic/ui/textarea";
export function Message() {
return <Textarea placeholder="Write a message" aria-label="Message" />;
}Auto-resize
The height follows the content with a spring between minRows (default 3) and maxRows (default 8). Set autoResize={false} to use a fixed number of rows.
<Textarea minRows={2} maxRows={6} aria-label="Notes" />
<Textarea autoResize={false} rows={4} aria-label="Fixed" />Glow variant
Use variant="glow" for a soft glow on focus. The default variant is default.
<Textarea variant="glow" aria-label="Feedback" />Character counter
Set showCount to display a live counter. Combine it with maxLength to show the limit.
<Textarea showCount maxLength={200} aria-label="Bio" />Reveal tuning
blurPx and driftPx control the blur and travel of typed characters, and speed scales the animation duration.
<Textarea blurPx={6} driftPx={10} speed={1.5} aria-label="Tuned" />Invalid state
Set invalid to mark the field with aria-invalid and play a short shake.
<Textarea invalid aria-label="Comment" />Motion preferences
Height springs, character reveal, and the shake respect the Kinetic reduced-motion setting and the browser preference. Durations use the current tempo and the speed prop.
API Reference
Textarea
Zero-dependency multi-line textarea with spring-damped auto-resize height, live character counter, and invalid micro-shake.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "glow" | "default" | Focus ring treatment: crisp semantic border or soft outer glow. |
autoResize / minRows / maxRows | boolean / number / number | true / 3 / 8 | Enables spring-damped height growth bounded between minRows and maxRows. |
showCount / maxLength | boolean / number | false / undefined | Displays live character counter in the bottom-right corner with near-limit color states. |
invalid / speed | boolean / number | false / 1 | Triggers horizontal micro-shake on error and scales spring/shake speed (0.25-4). |