Back to library
INTERACTION_128

Pinned Product Showcase.

The product mockup is pinned while its features annotate in turn. The mockup centred with all markers hidden before the trigger; revealing each marker and shifting the mockup slightly per step once scroll progress through the pinned section.

CATEGORY
Scroll
COMPLEXITY
Advanced
TECH
CSS + JS
PLATFORM
Both
PERFORMANCE
Medium
LIVE PLAYGROUND
CSS / CSS
/* Pinned Product Showcase — The product mockup is pinned while its features annotate in turn. */
.pinned-product-showcase {
  --dur: scroll-linked;
  --ease: linear;
  --stagger: 60ms;
  will-change: transform, opacity;
}

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

/* the mockup centred with all markers hidden -> revealing each marker and shifting the mockup slightly per step */
@keyframes pinned-product-showcase-in {
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

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

/** Pinned Product Showcase — trigger: scroll progress through the pinned section */
export function PinnedProductShowcase({ 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="pinned-product-showcase" data-state="out">
      {children}
    </div>
  );
}

IF YOU LIKE THIS, STEAL THESE TOO.

INTERACTION_129CSS + JS

Horizontal Scroll Section

Vertical scrolling drives a horizontal panel track.

Scroll / MediumView
INTERACTION_130CSS + JS

Scroll Controlled Frame Sequence

Scroll scrubs through an image sequence like a film strip.

Scroll / HeavyView
INTERACTION_015CSS + JS

Scroll Reveal

Content fades and rises as it enters the viewport.

Scroll / LightView
INTERACTION_016CSS + JS

Blur Reveal

Content sharpens from blur as it enters view.

Scroll / MediumView