Night snow seen through a long lens, in three depth planes under your content; the warm hand melts the flakes it reaches and the hole closes when it leaves.
Rifugio Selle
Winter sale · 20% off shells until 6 January
Kit for long days above the tree line.
Wool, down and leather, tested on the Selle ridge every season. Free shipping over €120.
Use it for a seasonal storefront, holiday page or winter campaign. It sits behind your content and never takes clicks; set active={false} outside the season, and use shelter to keep snow off a header.
When not to use
Not for dense data screens or forms, where moving flakes add noise; leave those screens without a background effect.
Use it for a seasonal storefront, a holiday landing page or a winter campaign banner. It sits behind
your content and never takes clicks, so it can stay on a working page for the season. Effects are
visual pieces rather than controls: they do not replace the Interface components in dashboards and forms.
Wrap the part of the page that should have snow. The layer sits under the content (layer="under")
and shows wherever your content leaves the background open.
import { Snowfall } from "@/components/effects/snowfall"export function Storefront() { return ( <Snowfall className="min-h-screen bg-background"> <main>{/* your page */}</main> </Snowfall> )}
Without children the layer fills its positioned parent and reads the pointer there; give the parent
relative isolate.
shelter takes refs of elements the snow must not cross: flakes end on their top edge with a 4 px
fade. Use it for a translucent header, or for text when layer="over".
steady (default): all three planes, 22 flakes per 100 000 px², a light wind.
flurry: sparse, small and slow, almost vertical.
close-up: few flakes, many large near discs, the strongest parallax.
temperament (calm, lively, playful) scales fall speed and parallax on top of the preset.
density, drift and speed always win over the preset. active={false} removes the canvas and
stops the loop, for example outside the season.
Three CSS colors: the flake core, its shade (which keeps flakes readable on a white page) and the
key light rim. Any CSS color works, including var(--foreground).
The canvas is aria-hidden and pointer-events: none: links, buttons and text selection under
or over it work as without it. It never takes focus.
With layer="under" (default) flakes are only seen where your content is transparent. With
layer="over" the large near discs are capped at about 12% opacity and shelter keeps text clear.
On touch screens an automatic hand drifts across and melts a path; a finger takes over and the
hand returns 1.5 s after release. Vertical scrolling stays with the page.
One still frame with the three planes spread evenly (fixed seed); no fall, no melt, no parallax. The
hooks read usePrefersReducedMotion, so the MotionKitProvider setting applies too.
One 2D canvas. Each plane is a sprite drawn once; a frame only copies bitmaps, at most 360 flakes
whatever the size, so it stays well under 2 ms per frame at 1440 px.
The loop stops off screen and in hidden tabs, the device pixel ratio is capped at 2, and
active={false} destroys the canvas.
Source size is checked against the 15 KB gzip budget for effects (pnpm size).
Technical sheet
Motion
calm
260 ms · bounce 0
lively
400 ms · bounce 0.3
playful
540 ms · bounce 0.45
Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Size
Not measured yet · budget 15.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom.
Dependencies
motion
Triggers
pointer movement, ambient loop (pauses off screen and in hidden tabs)
Reduced motion
One still frame with the three planes spread evenly (fixed seed); no fall, no melt, no parallax.
Keyboard
No keyboard interaction of its own.
Browsers
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)