crucıble

Sandcast

Headline cast in fine gold sand: the text is sampled into grains that scatter with velocity and curl under the cursor, then trickle back home with staggered springs and a settling drift; idles on its own when untouched.

canvaspro

Installation

CLI

npx shadcn@latest add @crucible/sandcast

Props

PropTypeDefaultDescription
textstring"SANDCAST"Headline cast in sand (also emitted as sr-only text).
gapnumber3Sampling gap in px between grains — smaller = denser, more particles.
particleSizenumber1.7Base grain size in px (each grain jitters around it).
colorsstring[]warm goldsGrain palette, assigned per particle. Keep it a narrow single-hue ramp — the default is fine gold sand.
scatterRadiusnumber100Pointer repulsion radius in px.
strengthnumber1Pointer repulsion strength multiplier.
stiffnessnumber1Return-spring stiffness multiplier — how eagerly grains trickle home.
speednumber1Simulation-rate multiplier.
pausedbooleanfalseFreeze the simulation (grains hold their current positions).
seednumber5Deterministic seed for grain jitter and the entrance drift.
idlebooleantrueIdle autoplay: after 1.5s with no pointer over the sand, a ghost hand makes an occasional slow pass through the word (a lighter brush than a real pointer), then rests so the letters heal crisp between passes. A real pointer takes over instantly. Never under reduced motion; sleeps offscreen and when paused.
refReact.Ref<SandcastHandle>React 19 ref prop — imperative replay() of the blow-in entrance.
Also accepts all props of Omit<React.ComponentPropsWithoutRef<"div">, "children" | "color"> — they pass through to the underlying element.

Honors prefers-reduced-motion with a designed static fallback, pauses offscreen and on hidden tabs, and passes className through.