Skip to content

Glow checkbox

Checkbox with a spring-physics checkmark that overshoots on toggle. Border glows with cursor-mapped pastel colour on proximity. Box fills with pastel when checked, with a subtle outer bloom.

  • Spring Physics
  • requestAnimationFrame
  • pastelColour

Usage

Drop it in

import
import { GlowCheckbox } from "@/app/lib/components/glow-checkbox";
example 1
<GlowCheckbox checked={on} onChange={setOn} label="Remember me" />
<GlowCheckbox checked={false} onChange={() => {}} disabled label="Locked" />

API

Props

PropTypeDefault
checked*

Whether the checkbox is checked

boolean—
onChange*

Called when the user clicks the checkbox

(checked: boolean) => void—
label

Label text rendered beside the checkbox

string—
disabled

Disables the checkbox and suppresses all glow and spring motion

booleanfalse
className

Additional class names applied to the outermost wrapper

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.