Glow textarea
Multiline textarea with a floating label that springs on focus and a cursor-mapped pastel border glow. Same light system as glow-input — resizable, with spring physics on every interaction.
- Spring Physics
- requestAnimationFrame
- pastelColour
glow-textarea
Focus any field. Move your cursor.
Usage
Drop it in
import { GlowTextarea } from "@/app/lib/components/glow-textarea";<GlowTextarea label="Bio" rows={4} value={bio} onChange={setBio} />
<GlowTextarea label="Notes" disabled rows={3} />API
Props
| Prop | Type | Default |
|---|---|---|
labelFloating label text that springs above the textarea on focus or when a value is present | string | "Label" |
valueControlled textarea value | string | "" |
onChangeChange handler called on every keystroke | (value: string) => void | — |
placeholderPlaceholder shown once the label has floated and the field is focused | string | "" |
errorError message — locks glow to soft coral pastel and renders message below the textarea | string | — |
disabledDisables the textarea and suppresses all glow and spring motion | boolean | false |
rowsNumber of visible text rows | number | 4 |
classNameAdditional class names applied to the outermost wrapper div | string | "" |
Read from the component's source at build time. * required.
Accessibility
Works with
- Cursor
- Reacts to where the pointer is, not just whether it's over the element.
- Touch
- Follows your finger while it's down, then settles a moment after you lift.
- Keyboard
- Focus lights it up the way the cursor does. Every action has a key.
- Reduced motion
- Nothing moves or springs. Colour still answers, without drifting.