How to Recreate Apple's Scroll Animations in React

15 minUpdated

How Apple's scroll-driven product pages work, and how to build the same scroll animation in React with an image sequence on canvas, GSAP ScrollTrigger or a free ready-made component.

Wensity cover graphic for How to Recreate Apple's Scroll Animations in React
On this page

Apple's scroll animations work by tying an animation's progress to the scroll position instead of to time. On pages like the AirPods Pro launch, the product turns and opens as you scroll because the page is drawing a sequence of still images onto a canvas, picking the frame that matches how far you have scrolled. Scroll back up and it plays in reverse, frame by frame. You can build the same effect in React with an image sequence, a canvas and a scroll progress value, or drop in a free component that does it for you.

This guide explains how Apple-style scroll animations actually work, why a plain video struggles, and how to build one step by step in React, with Motion, with GSAP ScrollTrigger, or with a ready-made component. It also covers sticky sections, smooth scrolling, performance on phones and reduced motion.

The short answer

Export your product video as 100 to 200 compressed WebP frames, preload them, map scroll progress from 0 to 1 onto a frame number, and draw that frame on a canvas inside a pinned section. The free Scrubbable Video Reveal component does all of this in React with one array of image URLs.

What is a scroll-driven animation?

A scroll-driven animation is one whose progress is controlled by scrolling. Scroll down and it moves forward, stop and it pauses, scroll up and it plays backward. The scrollbar becomes the timeline. It is often confused with a few related effects:

EffectWhat happensExample
Scroll-triggered animationPlays once, on its own timing, when an element enters the viewportA card that fades in
Scroll-driven (scrubbed) animationProgress follows the scroll position in both directionsApple's rotating product reveals
Parallax scrollingLayers move at different speeds to create depthA background that drifts slower than the text
ScrollytellingA story told in steps as the reader scrolls, often with pinned visualsLong-form news features

Apple's product pages combine the last three. A section pins in place, a scrubbed animation plays inside it, and the copy changes as the story moves forward.

How Apple's scroll animations actually work

If you inspect Apple's well-known AirPods Pro page, the moving product is not a video. It is a <canvas> element. The page loads a numbered sequence of still images, such as 0001.jpg, 0002.jpg and so on, and draws whichever frame matches the current scroll position onto the canvas. The section around it is pinned with sticky positioning, so the canvas stays on screen while you scroll through a tall block of space.

Three pieces make it work:

  • A frame sequence. A short product render exported as individual images, usually between 60 and 200 frames.
  • A scroll progress value. How far the reader has scrolled through the section, from 0 at the start to 1 at the end.
  • A canvas. Each time the progress changes, the page draws the matching frame with drawImage().

Newer Apple pages mix this with other techniques, such as scroll-controlled video and sticky feature sections, but the image sequence on a canvas is the version people mean when they ask how Apple does it.

Why not just scroll a video?

The obvious idea is to put a <video> on the page and set its currentTime from the scroll position. It works for slow, forward scrolling, then falls apart when people scroll fast or back up.

Most video files use temporal compression. Only some frames, called keyframes, are stored as complete images. Every other frame is stored as the difference from the frames around it. To show a frame in the middle, the browser has to decode from the nearest keyframe forward. Seeking backward quickly means decoding long chains of frames, which shows up as stutter and frozen frames.

You can reduce this by encoding a video where every frame is a keyframe:

Source
ffmpeg -i product.mp4 -c:v libx264 -g 1 -crf 23 -an -movflags +faststart product-scrub.mp4

Scrubbing gets much smoother, but the file becomes many times larger, and browsers still differ in how quickly they seek. For short, high-quality product reveals, an image sequence on a canvas gives the most reliable result, because every frame is already a complete picture and jumping to any of them is instant.

Build an Apple-style scroll animation in React

1. Export your video as image frames

Use ffmpeg to extract frames at the size you will actually display. This pulls 25 frames per second, scales them to 1200 pixels wide, and saves numbered JPEGs:

Source
ffmpeg -i product.mp4 -vf "fps=25,scale=1200:-1" -q:v 3 public/sequence/frame-%04d.jpg

A 6-second clip at 25 frames per second gives 150 frames. Then convert them to WebP, which is usually far smaller at the same quality. Many ffmpeg builds, including the default Homebrew one, do not include a WebP encoder, so Google's cwebp tool is the dependable route:

Source
for f in public/sequence/frame-*.jpg; do
cwebp -quiet -q 75 "$f" -o "${f%.jpg}.webp" && rm "$f"
done

In our test, this cut a 150-frame sequence from 5.3 MB of JPEGs to 1.8 MB of WebP files.

2. Install the Scrubbable Video Reveal component

Scrubbable Video Reveal is a free Wensity UI component that implements Apple's technique in React. It preloads the frames, tracks scroll progress, draws each frame on a sharp, high-density canvas and pins it in place while you scroll. Install it with the Wensity CLI or the shadcn CLI:

Source
npx wensity@latest add scrubbable-video-reveal
Source
npx shadcn@latest add @wensity/scrubbable-video-reveal

It has one dependency, framer-motion, which the install adds for you.

3. Pass it your frames

Build the list of frame URLs with a loop, and pass it to the component. That is the whole integration:

Source
"use client";
import { ScrubbableVideoReveal } from "@/components/wensity/scrubbable-video-reveal";
const frames = Array.from(
{ length: 150 },
(_, i) => `/sequence/frame-${String(i + 1).padStart(4, "0")}.webp`
);
export function ProductReveal() {
return <ScrubbableVideoReveal frames={frames} useWindow travel={3} />;
}

useWindow makes the sequence follow the page's own scroll, which is what you want on a real landing page. travel sets how much scrolling the sequence takes, as a multiple of the viewport height.

4. How the scroll-to-frame math works

If you want to build your own version, the core is only a few lines. The component uses Motion's useScroll hook to read progress through the section, turns that into a frame number, and redraws only when the number changes:

Source
const { scrollYProgress } = useScroll({
target: targetRef,
offset: ["start start", "end end"],
});
const frameIndex = useTransform(scrollYProgress, (p) =>
Math.round(Math.min(1, Math.max(0, p)) * (frames.length - 1))
);
useMotionValueEvent(frameIndex, "change", (index) => {
if (index !== lastIndexRef.current) drawFrame(index);
});

scrollYProgress runs from 0 when the section's top reaches the top of the viewport to 1 when its bottom reaches the bottom. Multiplying by the last frame index and rounding gives a whole frame number, and skipping repeat values means the canvas is never repainted with the same frame while the reader pauses.

Props you can tune

PropDefaultWhat it does
framesrequiredOrdered list of image URLs, one per frame
aspect"16 / 10"Aspect ratio of the canvas
travel3Scroll distance for the whole sequence, in viewport heights
framedtrueDraws a device-style frame around the canvas
stickytruePins the canvas with position: sticky while scrolling
useWindowfalseFollows the page scroll instead of an inner scroll container
preload"eager"Loads frames up front, or lazily with "lazy"
height"640px"Height of the inner scroll container when useWindow is off

travel has the biggest effect on how the animation feels. If it seems rushed, raise travel before adding frames. The same frames spread over more scrolling look slower and give the reader more control.

The same effect with GSAP ScrollTrigger

GSAP's ScrollTrigger plugin is the other popular way to build scroll animations, and it is now free, including all of its plugins. The pattern is the same: animate a frame number from the first frame to the last, let ScrollTrigger scrub it with the scrollbar, and draw the current frame each update. In React, run it inside the useGSAP hook from @gsap/react so it cleans up after itself:

Source
"use client";
import { useRef } from "react";
import gsap from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
import { useGSAP } from "@gsap/react";
gsap.registerPlugin(ScrollTrigger, useGSAP);
export function ProductSequence({ frames }: { frames: string[] }) {
const sectionRef = useRef<HTMLElement>(null);
const canvasRef = useRef<HTMLCanvasElement>(null);
useGSAP(() => {
const canvas = canvasRef.current!;
const ctx = canvas.getContext("2d")!;
const images = frames.map((src) => {
const img = new Image();
img.src = src;
return img;
});
const state = { frame: 0 };
const render = () => {
const img = images[state.frame];
if (img.complete) ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
};
images[0].onload = render;
gsap.to(state, {
frame: frames.length - 1,
snap: "frame",
ease: "none",
onUpdate: render,
scrollTrigger: {
trigger: sectionRef.current,
start: "top top",
end: "+=300%",
scrub: 0.5,
pin: true,
},
});
}, { scope: sectionRef });
return (
<section ref={sectionRef}>
<canvas ref={canvasRef} width={1200} height={750} />
</section>
);
}

scrub: 0.5 makes the animation catch up to the scrollbar over half a second, which smooths out jumpy mouse wheels, and pin: true holds the section in place for the length set by end. Choose GSAP if the page is a long choreographed timeline with many pinned scenes. Choose the Motion-based component if you want a single drop-in sequence that fits a React codebase with no extra setup.

Pinned sticky scroll sections

Apple's pages also pin whole sections while their content changes, so a product image stays put as the feature description beside it updates. The CSS behind it is position: sticky on an element inside a much taller parent:

Source
.scene {
height: 300vh;
}
.scene__pinned {
position: sticky;
top: 0;
height: 100vh;
}

The pinned child stays on screen for the full height of its parent, and scroll progress through the parent decides what it shows. Apple-Style Sticky Scroll builds this pattern as a component: a pinned section whose panels of title, copy and image morph in step with scroll in both directions. Pair it with an image sequence and you have the full Apple product page structure.

Do you need smooth scrolling?

Smooth scrolling libraries like Lenis and Locomotive Scroll add inertia, so the page glides after you stop scrolling instead of moving in fixed steps. Many scroll-heavy marketing sites use one, and Lenis can be paired with GSAP ScrollTrigger.

You do not need one for an Apple-style sequence. Native scrolling already feels smooth on trackpads and phones, and scrubbed animations look fine with it. If you add a smooth scroll library, test it with a mouse wheel, a keyboard and a screen reader, because overriding native scrolling can make pages feel sluggish and harder to use, and switch it off for people who ask for reduced motion.

Performance on desktop and mobile

Image sequences are fast to draw but heavy to hold. A few habits keep them smooth:

  • Size frames for the screen. Every decoded 1200 by 750 frame takes about 3.6 MB of memory, so 150 frames can reach several hundred megabytes. Ship smaller frames to phones and never ship 4K frames into a 1200 pixel canvas.
  • Keep the frame count honest. 100 to 200 frames covers most reveals. Fewer looks steppy, more adds weight without looking smoother.
  • Use WebP. It is usually much smaller than JPEG or PNG at the same visual quality.
  • Preload only what is close. Load eagerly for a sequence near the top of the page, and lazily for one further down.
  • Cap the pixel ratio. Drawing at more than twice the CSS size rarely looks sharper. Scrubbable Video Reveal caps its canvas at a device pixel ratio of 2.
  • Test fast reverse scrolling. A quick flick upward is the real stress test, not a slow scroll down.

Accessibility and reduced motion

Large scroll-driven motion can make some people feel dizzy, so respect the reduced motion setting. In CSS, wrap motion in a prefers-reduced-motion media query. In JavaScript, check the same preference before starting a sequence.

Scrubbable Video Reveal handles this for you. With reduced motion turned on, it shows the final frame as a still image, downloads only that one frame, removes the extra scroll height and never scrubs. The content is still there, without the movement. Give the canvas a text alternative, such as a short caption describing the product, so screen reader users get the same information.

Common mistakes to avoid

  • Scrubbing a normal MP4. Backward seeking stutters unless every frame is a keyframe, and then the file is huge.
  • Shipping full-resolution frames. They download slowly and use far more memory than the canvas needs.
  • Too little scroll distance. If the animation feels rushed, add scroll travel before adding frames.
  • Forgetting the pinned container. Without a tall parent and a sticky child, the canvas scrolls away before the sequence finishes.
  • Ignoring reduced motion. Always provide a still alternative.
  • Hijacking scroll for no reason. Smooth scroll libraries are optional, and native scrolling is often the better experience.

Frequently asked questions

On pages like the AirPods Pro launch, Apple draws a sequence of pre-rendered still images onto a canvas element and picks the frame that matches the current scroll position. The section is pinned with sticky positioning so the canvas stays on screen while you scroll through it.

Yes, but scrubbing a normal compressed video backward stutters, because most frames are stored as differences from nearby keyframes. Encoding with every frame as a keyframe, for example with ffmpeg -g 1, makes it smoother but much larger. An image sequence on a canvas is the most reliable option for short product reveals.

Between 100 and 200 frames suits most product reveals. Fewer frames look steppy, and many more add download size and memory without looking noticeably smoother. If the motion feels rushed, increase the scroll distance before adding frames.

Use ffmpeg, for example ffmpeg -i product.mp4 -vf "fps=25,scale=1200:-1" -q:v 3 frame-%04d.jpg, then convert the JPEGs to WebP with the cwebp tool to cut the file size.

Both work. GSAP ScrollTrigger is strong for long, choreographed pages with many pinned scenes, and it is now free with all plugins. Motion's useScroll hook fits naturally into React components. Scrubbable Video Reveal uses Motion and needs no setup beyond a list of frames.

Yes. It is a free Wensity UI component. Install it with npx wensity@latest add scrubbable-video-reveal or the shadcn CLI, and the full source is added to your project.

Yes, with care. Use smaller frames on phones, keep the frame count reasonable, and test fast scrolling in both directions. Each decoded frame uses memory, so oversized sequences are what usually cause trouble on mobile.

The bottom line

Apple's scroll animations are not magic: a pinned section, a set of still frames and a canvas that draws the frame matching the scroll position. Export frames at the right size, convert them to WebP, keep the count between 100 and 200, give the sequence enough scroll distance, and always provide a still image for reduced motion. Install Scrubbable Video Reveal to get it working in minutes, use GSAP ScrollTrigger when you need a longer timeline, and add Apple-Style Sticky Scroll for pinned feature sections. For the wider picture of how Apple designs its pages, read Apple's design language explained, and for choosing between CSS and Motion for the rest of your animations, see Framer Motion vs CSS animations.


Parth Sharma

Parth Sharma

Founder, Wensity

Full stack developer and founder of Wensity. Obsessed with pixel perfect, high performance web experiences that feel alive.

Enjoyed this article?

Related articles

Wensity cover graphic comparing Framer Motion and CSS animations in 2026
15 min

Framer Motion vs CSS Animations in React: Which Should You Use in 2026?

When to use CSS animations and when to use Framer Motion (now Motion) in React, covering scroll animations, View Transitions, exit and layout animations, performance, Tailwind CSS and GSAP.

Read article
Wensity cover graphic for How to Optimize a Next.js App in 2026
17 min

How to Optimize a Next.js App in 2026: The Next.js 16 Performance Guide

A practical Next.js 16 performance guide: Core Web Vitals, the bundle analyzer, Server Components, next/image, next/font, next/script, Cache Components, the React Compiler and SEO, with the real setup behind a production Next.js site.

Read article
← Previous article
Wensity cover graphic comparing Framer Motion and CSS animations in 2026
15 min

Framer Motion vs CSS Animations in React: Which Should You Use in 2026?

Next article →
Wensity cover graphic breaking down the anatomy of Apple's design language
16 min

Apple's Design Language Explained: Principles, Liquid Glass and UI Design