React AnimeJS

Blocks

Example blocks

Self-contained patterns built with react-animejs — copy-paste starting points you can drop into your own app.

Cursor Trail · Images

<Anime>

A queue of sprites, each owning its own useAnimatable x/y. On pointermove every sprite eases toward the cursor with a progressively longer duration — the head follows tight, the tail lags.

Move your cursorspawn · zoom-in / zoom-out · fade

Grid Flip Modal · Tile to Modal

AnimeLayout · createLayout

Click a tile and it flies into a centered modal; click again to send it back. The real DOM node is reparented into a <dialog> inside a single AnimeLayout root (with children:'*'), so anime.js’s layout system correlates the old grid position with the new modal position via a shared data-layout-id and FLIP-animates the size + position change on an inOutQuad curve.

Animate CSS Grid Flip · Area Swap

AnimeLayout + createLayout

Select a bottom tile to promote it into the large hero area. The previous hero takes its slot while AnimeLayout measures the CSS Grid before/after positions and FLIP-animates each real tile into place.

click a bottom tile · positions interpolate01 / 04

Cursor Tracking · Image Preview

useAnimatable + Anime

Hover a thumbnail and a larger preview window chases the cursor with spring-eased movement (useAnimatable translate setters fed on every pointermove). Moving between thumbnails swaps the image with an <Anime> cross-fade so it never hard-cuts.

hover a thumbnail · preview tracks the cursor

Add To Cart · Arc Fly

Anime · keyframes

Click Add to cart and a sprite arcs from the card to the basket along a three-point keyframe curve (origin → lifted midpoint → basket). The declarative <Anime> drives translate, scale, and the basket’s impact pulse.

🧢

Snapback Cap

$32.00

🧺
Cart · 0
click add to cart · arcs into the basket

Pointer Collision · Swept Grid

useAnimatable

A 20×20 grid that lights every cell the pointer sweeps — even on a fast flick. On each pointermove a supercover line walks from the last cell to the current one, lighting all cells in between. Each cell owns a useAnimatable that flashes and fades it.

flick fast · swept collision lights every cell

Tilt Card

useAnimatable

The card tilts in 3D toward the cursor. Pointer position maps to rotateX/ rotateY setters from useAnimatable, which ease toward each new value — and a glare highlight follows the pointer. Leaving the card springs it back to level.

Hover me

rotateX · rotateY · useAnimatable

move the cursor · card tilts in 3D

Image Reveal · Before / After

useAnimatable

A draggable handle reveals one image over another. A single drag value feeds two useAnimatable setters — the overlay’s width and the handle’s left — easing in lockstep with pointer capture holding the drag through fast flicks.

BeforeBefore
AfterAfter
drag the handle · reveal before / after

macOS Dock · Fisheye

useAnimatable

Icons magnify toward the cursor with a smooth inverted-parabola falloff so neighbors rise too — the signature dock “genie”. Each icon owns a useAnimatable for scale + translateY; one dock-level pointermove computes every icon’s target from its distance to the cursor. Leaving springs them back to rest.

interactive dockuseAnimatable / 08 apps
move across icons · magnify with intention

Orchestrated easeReverse · Exit Controls

useAnimeTimeline

Toggle easeReverse to compare transitions: ON executes a custom closing sequence with smooth, non-bouncy curves (outQuad) and adjustable speed, while OFF plays the entrance sequence in reverse (reversing the bouncy outBack animation).

Scrubbed Bento Gallery · Scroll Zoom

useAnimeOnScroll + utils.lerp

A 3×3 bento grid sits centered inside a scrollable box; as you scroll inside the box, the grid tracks interpolate from compact to huge (33% → 100%). Centering + overflow: hidden turns that into a zoom — the center image fills the box while the rest scatter off-canvas, then a content panel fades in. A port of the GSAP “Scrubbed Bento Gallery” driven by one useAnimeOnScroll observer (scoped to a container) scrubbing utils.lerp on the grid tracks.

01
02
03
04
06
07
08
09

Scrubbed · Grid-track zoom

Keep scrolling · one image takes over

The reveal

One image, full focus.

The bento collapsed into a single fullscreen frame as you scrolled, the hero held for a beat, then slid up to reveal this section — a pinned scrub sequence built entirely with useAnimeOnScroll driving a grid-track interpolation through utils.lerp. No FLIP plugin, no manual requestAnimationFrame loop.

useAnimeOnScroll

One observer scrubs the whole zoom, scoped to a container.

utils.lerp

Interpolates grid tracks 33% → 100% so only the center cell wins.

sticky + clip

Centering + overflow turns track growth into a zoom-to-fill.

scroll inside the box · bento zooms, hero holds, then reveals
0%

Scroll-based Image Sequence · Apple Style

useAnimeOnScroll + useAnime

An Apple-style scroll-driven canvas image sequence preloading 147 frames. Syncs scroll progress to the active frame index using a plain object playhead, or switches to autoplay mode with loops and adjustable speeds. Storytelling overlays fade in and out at specific frames.

0%

Preloading 147 frames

AirPods Pro

Redesigned for Magic

An immersive listening experience with active noise cancellation, customizable fit, and sweat/water resistance.

Active Noise Cancellation

Silence is Golden

Outward-facing microphones detect external sound, counteracting it with anti-noise before you hear it.

Immersive Sound Architecture

H1 Chip Power

The H1 chip delivers incredibly low audio latency, real-time noise processing, and custom high-excursion drivers.

Wireless Charging Case

Non-stop Playback

Keep the music going with multiple charges in your pocket. Compatible with Qi-certified wireless chargers.

Image Sequence · Scroll-Scrub

Scroll the card container to animate the model

scroll inside box to scrub
0%

Image Comparison · Scroll Reveal

<AnimeScroll> + opposing transforms

Scroll through a pinned before/after frame. The after panel moves in from the right while its image counter-moves from the left. AnimeScroll scopes progress to the fixed comparison panel, with no page-height expansion or infinite loop.

Before color grade
After color grade
before / raw light
after / color grade

Scroll comparison / 01

Scroll to reveal the other side.

keep scrolling
pinned stage → opposing image transformsfinite / scrubbed

Animated Continuous Sections · Split Slide

createTimeline() + SplitText

Use one wheel, touch, or keyboard gesture to advance a finite sequence of full-frame scenes. Opposing wrappers create the layered slide while Anime.js SplitText settles each heading character independently.

scroll inside
observer gesture · layered scene · finite

01 / First signal

01 / 05

Layered Pinning · Finite Stack

<AnimeScroll> + sticky

A self-contained panel stack inspired by GreenSock’s layered pinning pattern. Each panel pins at the top of the stage while the next panel layers over it in one continuous, finite scroll sequence.

Signal / 01
01

Start with intent.

A scroll sequence that gives every panel its own moment in the spotlight.

Layered pin · 01 / 5
Signal / 02
02

Let layers build.

Sticky positioning keeps the scene pinned while the next chapter arrives on top.

Layered pin · 02 / 5
Signal / 03
03

Hold the frame.

A focused stage, deliberate contrast, and a little breathing room for the motion.

Layered pin · 03 / 5
Signal / 04
04

Shift the rhythm.

A steady scroll rhythm lets each transition land without forcing the browser to jump.

Layered pin · 04 / 5
Signal / 05
05

Return to the source.

The finite sequence ends cleanly after the final layer, ready for the next block on the page.

Layered pin · 05 / 5

Layered pinning · finite stack

Scroll to stack the panels

wheel inside the stage · five pinned layers
01 / 5

Scroll Shader · Velocity Distortion

<AnimeScroll> + WebGL

A native WebGL image stack where AnimeScroll feeds signed scroll velocity into a cover-mapped shader. Move faster to pull the RGB channels apart; every frame falls back to its image when WebGL is unavailable.

Scroll shader / WebGL canvas

Let velocity leave a trace.

Each frame is its own shader surface. Scroll faster to pull color apart and bend the image.

Shader frame / 01

Electric weather

image fallback
Shader frame / 02

Red horizon

image fallback
Shader frame / 03

Quiet geometry

image fallback
Shader frame / 04

Tidal memory

image fallback
live distortion0%
scroll velocity → shader strength

Scroll Batch Gallery · Staggered Enter

IntersectionObserver + stagger()

A grid of images that stagger-fades in as each enters the viewport — a port of GSAP’s ScrollTrigger.batch(). A container-scoped IntersectionObservercollects items entering within the same 100ms window, then Anime.js animates that batch with stagger().

01Quentin
02Elizabeth
03Alex
04Morgan
05Sam
06Riley
07Jamie
08Casey
09Jordan
10Taylor
11Avery
12Maya
13Noah
14Sage
15Robin
16Kai
17Remy
18Drew
scroll inside the box · entering items are batched and staggered

Canvas Particles · Timeline Renderer

AnimeTimeline + Canvas

A canvas particle field driven by one AnimeTimeline. Each particle is a plain JavaScript target with function-based positions and staggered timing; the timeline’s update callback redraws the canvas, while the controls toggle playback speed.

Curve Swipe · SVG Morph

AnimeTimeline · SVG path

Click the stage to raise and lower an SVG curve. Two sequential d path morphs are composed in AnimeTimeline, then played forward or reversed from the same timeline.

Dynamic Shape Overlays · Cascade Morph

AnimeMorph · SVG path

Click the stage to cascade-cover it. Four stacked SVG layers each morph their d attribute through a keyframe sequence (flat → curve → full cover) via one AnimeMorph per layer; an incremental stagger on play()/reverse() makes the reveal read as a travelling wave. A port of the codrops “Dynamic Shape Overlays”.

Dynamic Shape Overlaysclick to cover
AnimeMorph · SVG path morph

Horizontal SplitText · Nested Scroll

SplitText + useAnimeOnScroll

A pinned box scrubs a long line of SplitText characters sideways as you scroll vertically. Each char settles in with a random vertical offset + rotation tied to its horizontal position on screen — GSAP’s containerAnimation trick, replicated with one useAnimeOnScroll scrub driving a per-frame back.out ease.

The containerAnimation property lets us create ScrollTriggered animations inside a horizontally scrolling container — nested scroll, where every character settles in based on its position on screen.

Horizontal · SplitText scrub

Scroll the box · text drifts sideways

scroll inside the box · chars settle as they cross
0%