Back to library
INTERACTION_136

Stacked Scroll Panels.

Sections stack over one another like cards on a table. Each panel positioned below the previous before the trigger; sticking each panel then scaling the one behind to 0.96 as it is covered once scroll position.

CATEGORY
Scroll
COMPLEXITY
Intermediate
TECH
CSS
PLATFORM
Both
PERFORMANCE
Light
LIVE PLAYGROUND
CSS / CSS
/* Stacked Scroll Panels — Sections stack over one another like cards on a table. */
.stacked-panels {
  --dur: scroll-linked;
  --ease: linear;
  --stagger: 60ms;
  will-change: transform, opacity;
}

.stacked-panels > * {
  opacity: 0;
  transform: translateY(14px);
  animation: stacked-panels-in var(--dur) var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * var(--stagger));
}

/* each panel positioned below the previous -> sticking each panel then scaling the one behind to 0.96 as it is covered */
@keyframes stacked-panels-in {
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stacked-panels > * {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
React / TSX
import { useEffect, useRef } from "react";

/** Stacked Scroll Panels — trigger: scroll position */
export function StackedScrollPanels({ children }: { children: React.ReactNode }) {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current;
    if (!el) return;
    if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
      el.dataset["state"] = "in";
      return;
    }
    const io = new IntersectionObserver(
      ([entry]) => {
        if (entry?.isIntersecting) {
          el.dataset["state"] = "in";
          io.unobserve(el);
        }
      },
      { threshold: 0.2 },
    );
    io.observe(el);
    return () => io.disconnect();
  }, []);

  return (
    <div ref={ref} className="stacked-panels" data-state="out">
      {children}
    </div>
  );
}

IF YOU LIKE THIS, STEAL THESE TOO.

INTERACTION_127CSS

Sticky Storytelling Section

A sticky visual holds while the copy beside it advances.

Scroll / LightView
INTERACTION_134CSS

Timeline Progression

A vertical line draws down and reveals each milestone.

Scroll / LightView
INTERACTION_135CSS

Zoom Through Section

The section scales up and passes the viewer as they scroll.

Scroll / MediumView
INTERACTION_015CSS + JS

Scroll Reveal

Content fades and rises as it enters the viewport.

Scroll / LightView