crucıble

Lantern

A spotlight cursor: wraps any content, dims the surface, and cuts a soft radial light that spring-follows the pointer to reveal what's beneath — ringed by a faint warm falloff and flaring brighter on press (rapid presses stack). Children stay interactive; idles on its own when untouched, and settles to a static centered spotlight under reduced motion.

motionfree

Installation

CLI

npx shadcn@latest add @crucible/lantern

Manual — install dependencies, then copy the source

npm install motion

Props

PropTypeDefaultDescription
childrenReact.ReactNodeContent revealed beneath the light. Everything outside the spotlight is dimmed.
classNamestring
radiusnumber190Spotlight radius in px.
softnessnumber0.6Edge feather, 0 (crisp cut) → 0.95 (very soft falloff).
intensitynumber0.9How dark everything outside the light gets, 0 → 1.
colors{ /** Tint of the darkened area outside the light. @default "#050608" */ dim?: string; /** Warm light cast at the spotlight's falloff edge. @default "#ffce8a" */ glow?: string; }Palette of the lantern.
spring{ stiffness?: number; damping?: number; mass?: number }Spring physics for the follow. Softer = the light lags further behind the cursor.
pulseOnClickbooleantrueExpand + brighten the light on pointer press.
pausedbooleanfalseFreeze to the static centered spotlight (no follow).
idlebooleantrueIdle autoplay: after 1.5s with no pointer inside, a ghost hand sweeps the light along a slow Lissajous path (with the odd gentle flare) so the surface never looks dead; a real pointer takes over instantly. Also runs on touch-only devices. Never under reduced motion; sleeps offscreen.
refReact.Ref<LanternHandle>React 19 ref prop — imperative pulse(x?, y?).

Honors prefers-reduced-motion with a designed static fallback, and passes className through.