Skip to content

Glow input

Text input with a floating label that springs on focus and a cursor-mapped pastel border glow. Label and border share the same colour source — they feel like one light system.

  • Spring Physics
  • requestAnimationFrame
  • pastelColour

glow-input

Incorrect password

Focus any field. Move your cursor.

Usage

Drop it in

import
import { GlowInput } from "@/app/lib/components/glow-input";
example 1
<GlowInput label="Email address" type="email" value={email} onChange={setEmail} />
<GlowInput label="Password" type="password" error="Incorrect password" value={pw} onChange={setPw} />

API

Props

PropTypeDefault
label

Floating label text that springs above the input on focus or when a value is present

string"Label"
value

Controlled input value

string""
onChange

Change handler called on every keystroke

(value: string) => void—
type

HTML input type

"text" | "email" | "password" | "search" | "url" | "tel""text"
placeholder

Placeholder shown once the label has floated and the field is focused

string""
error

Error message — locks glow to soft coral pastel and renders message below the input

string—
disabled

Disables the input and suppresses all glow and spring motion

booleanfalse
className

Additional 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.