Motion+

Parallax

Scroll-linked parallax effect where background images move at a different speed to foreground content, creating a sense of depth.

Time
5 min
Difficulty
Intermediate
Access
Motion+
>Live exampleOpen

Introduction

The Parallax example shows how to build a full-page scrolling gallery where background images move at a different speed to the foreground text, creating a sense of depth. It also fades text in and out as each section moves through the viewport.

It uses three APIs from Motion:

  • useScroll to track how far each section has scrolled through the viewport
  • useTransform to map that scroll progress to image position and text opacity/position values
  • The motion component to apply those values as live styles