01.11 · Scroll-Based

Scrollytelling

A picture beside the story changes as you read down. Best for data stories.

Scroll it

Scroll inside the box, or press Play and it scrolls for you.

Copy the prompt

Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.

Add a scrollytelling layout to [your story and the picture that goes with it]. Put the story in a column of chapters that scrolls, and keep the picture in view beside it. Work out which chapter has passed a reading line about 40% down the view and how far it is toward the next, as a fraction, and blend every value in the picture between the two chapters with it, such as colors and a counting number, so the picture changes smoothly as the visitor reads. On phones, pin a short strip of the picture above the text. If the visitor has reduced motion turned on, change the picture without fading.

Replace the words in brackets with your own story and picture.

Free and open source. If this helped, a star on GitHub helps other people find it.

Star on GitHub

What it is

The full explanation is in README.md.

Good for

  • Data stories
  • Explainers
  • Long reads

Avoid on

  • Short pages
  • Quick reference