01.06 · Scroll-Based

Stacking Cards

Cards stick at the top and pile into a deck. Best for step-by-step stories.

Scroll it

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

Try it

Change a setting, then scroll again or press Play.

Edge that shows

The strip of each card left showing above the next.

How much cards shrink

Covered cards shrink so the deck looks deep.

More optionsFewer options

Number of cards

More cards make a taller deck and a longer scroll.

Copy the prompt

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

Add stacking cards to [your set of project or step cards]. Make each card stick to the top of the scrolling area so the next card slides up over it, and push each later card down by the offset in the settings so a strip of the cards underneath stays visible, like a deck. As a card is covered, shrink it slightly from its top edge, so buried cards look farther away. Leave some room after the last card so the finished deck stays on screen. Use scroll-driven animations where the browser supports them, with a small script as the fallback. If the visitor has reduced motion turned on, let the cards stack without shrinking. Match the settings listed below.

Replace the words in brackets with your own element. Your settings are added at the end.

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

  • Portfolios
  • Case studies
  • Onboarding steps
  • Feature tours

Avoid on

  • Long text
  • Many cards