Skip to main content

Textarea

A multi-line textarea with spring auto-resize height, a glow focus variant, a live character counter, and invalid shake.

85 / 240

Customize

Speed1

Installation

npx shadcn@latest add @kinetic/textarea

Usage

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.

PropTypeDefaultDescription
variant"default" | "glow""default"Focus ring treatment: crisp semantic border or soft outer glow.
autoResize / minRows / maxRowsboolean / number / numbertrue / 3 / 8Enables spring-damped height growth bounded between minRows and maxRows.
showCount / maxLengthboolean / numberfalse / undefinedDisplays live character counter in the bottom-right corner with near-limit color states.
invalid / speedboolean / numberfalse / 1Triggers horizontal micro-shake on error and scales spring/shake speed (0.25-4).

Notes

Textarea uses field-sizing-content; add a max-h-* class when growth should cap inside scrollable forms. Inside InputGroup, use InputGroupTextarea.