Desktop optimized

Please maximize your browser window or use a larger screen to explore the component library.

Go to home

Scatter Trail

A physics-based mouse trail that calculates pointer velocity to dynamically throw, slide, and spin images across the screen like dealing casino cards.

Last Modified:Aug 17, 2026

Install

CLI

scatter-trail
$pnpm dlx shadcn@latest add https://ui.satisium.com/r/scatter-trail.json

Or install a specific demo variant:

scatter-trail-avatars-demo
$pnpm dlx shadcn@latest add https://ui.satisium.com/r/scatter-trail-avatars-demo.json

Or install a specific demo variant:

scatter-trail-images-demo
$pnpm dlx shadcn@latest add https://ui.satisium.com/r/scatter-trail-images-demo.json

Manual

1. Add Source Code

Note: This component utilizes pure DOM manipulation and RequestAnimationFrame logic. No external libraries are required.

Props

PropTypeDefaultDescription
imageUrlsstring[][]Array of image URLs to randomly spawn.
distancenumber40Distance the pointer must move (in pixels) before spawning a new item.
durationnumber1500The total lifespan of a spawned item in milliseconds.
maxItemsnumber20Maximum items on screen before forcing the oldest to fade out.
itemSizenumber100The base pixel size of the image cards.
slideMultipliernumber120Multiplier for the throw distance based on mouse velocity. Higher = further.
maxSlidenumber400Absolute maximum pixels a card can slide to prevent flying off screen.
scatterSpreadnumber0.7How wide the angle of randomization is when a card is thrown (in radians).
classNamestringundefinedStandard Tailwind classes for the fixed wrapper.
itemClassNamestring""Standard Tailwind classes applied to the individual image wrappers.