Desktop optimized

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

Go to home

Pendulum Trail

An interactive mouse trail that maps spawned items to an invisible swinging pendulum axis, driven entirely by pointer velocity and physics length.

Last Modified:Aug 17, 2026

Install

CLI

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

Or install a specific demo variant:

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

Or install a specific demo variant:

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

Manual

1. Add Source Code

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

Performance Architecture

Traditional React-based particle trails suffer from severe Garbage Collection (GC) spikes because React constantly mounts and unmounts nodes. The Pendulum Trail circumvents this by pre-allocating a fixed array of DOM references (DOM_POOL_SIZE = maxItems * 3).

As the cursor moves, it accurately calculates the pixel-per-millisecond pointer velocity, maps it to a simulated pendulum arc, and strictly recycles the existing nodes using 3D hardware-accelerated transforms (translate3d), resulting in a flawless 60fps trail experience even on mobile devices.

Props

PropTypeDefaultDescription
imageUrlsstring[][]Array of image URLs to randomly spawn.
distancenumber70Distance the pointer must move (in pixels) before spawning a new item.
durationnumber3000The total lifespan of a spawned item in milliseconds.
maxItemsnumber15Maximum items on screen before forcing the oldest to gracefully shrink out.
itemSizenumber110The base pixel width of the image cards.
windAnglenumber10Base horizontal wind angle pushing the cards.
windSwaynumber5The intensity of the sine-wave flutter applied by the wind.
physicsLengthnumber40Length of the invisible string. Dictates the speed and arc of the swing.
classNamestringundefinedStandard Tailwind classes for the fixed wrapper.
itemClassNamestring""Standard Tailwind classes applied to the individual image wrappers.