Skip to content

Glow slider

Range slider with spring-physics thumb bounce on grab and release. Fill and border glow with cursor-mapped pastel colour. Drag intensifies the bloom. All motion via rAF springs, no CSS transitions.

  • Spring Physics
  • requestAnimationFrame
  • pastelColour
Volume
Opacity
Brightness

Usage

Drop it in

import
import { GlowSlider } from "@/app/lib/components/glow-slider";
example 1
<GlowSlider label="Volume" value={vol} onChange={setVol} />
<GlowSlider label="Opacity" min={0} max={1} step={0.01} value={op} onChange={setOp} />

API

Props

PropTypeDefault
value*

Current value

number—
onChange*

Called when the user drags or clicks to change value

(value: number) => void—
min

Minimum value

number0
max

Maximum value

number100
step

Step increment

number1
label

Label displayed above the slider

string—
showValue

Whether to show the numeric value on the right

booleantrue
disabled

Disables the slider and suppresses all glow and spring motion

booleanfalse
className

Additional class names applied to the outermost wrapper

string""
ariaLabel

Accessible name when no visible `label` is given

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.