Stagger on Scroll
paceui-gsap/stagger-on-scrollFreeComponent
Stagger elements into view with scroll-triggered fade, slide, zoom, or blur effects.
Live preview
live · rendered by the registry
Rendered by PaceUI GSAP on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://gsap.paceui.com/r/stagger-on-scroll.jsonSource
1"use client";23import { ComponentProps, useRef } from "react";45import { useGSAP } from "@gsap/react";6import gsap from "gsap";7import { ScrollTrigger } from "gsap/ScrollTrigger";89gsap.registerPlugin(ScrollTrigger);1011type EffectType = "scale" | "slideInRight" | "blur" | "random";1213type StaggerOnScrollProps = {14 effect?: EffectType;15} & ComponentProps<"div">;1617export const StaggerOnScroll = ({ effect = "scale", ...props }: StaggerOnScrollProps) => {18 const wrapperRef = useRef<HTMLDivElement | null>(null);1920 useGSAP(21 () => {22 if (!wrapperRef.current || !wrapperRef.current.children.length) return;2324 const animationPresets: Record<EffectType, gsap.TweenVars> = {25 scale: {26 opacity: 0,27 scale: 0.9,28 duration: 0.8,29 stagger: 0.15,30 ease: "power2.out",31 },32 slideInRight: {33 opacity: 0,34 x: 80,35 duration: 1,36 stagger: 0.1,37 ease: "back.out(1.4)",38 },39 blur: {40 opacity: 0,41 filter: "blur(10px)",42 duration: 0.8,43 stagger: 0.12,44 ease: "power2.out",45 },4647 random: {48 opacity: 0,49 x: () => gsap.utils.random(-100, 100),50 y: () => gsap.utils.random(-100, 100),51 duration: 0.9,52 stagger: 0.1,53 ease: "power2.out",54 },55 };5657 gsap.from(wrapperRef.current.children, {58 ...animationPresets[effect],59 scrollTrigger: {60 trigger: wrapperRef.current,61 start: "top 85%",62 },63 });64 },65 { scope: wrapperRef, dependencies: [effect] },66 );6768 return <div {...props} ref={wrapperRef} />;69};
What it pulls in
npm packages
Files it writes
More from PaceUI GSAP
All 29 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Modal Ability Selectorai-modal-ability-selector | PaceUI GSAP | Components | Free | 2 deps | |
| Modal Selectorai-modal-selector | PaceUI GSAP | Components | Free | 2 deps | |
| Response Writerai-response-writer | PaceUI GSAP | Components | Free | 2 deps · 2 files | |
| AI Suggestionsai-suggestions | PaceUI GSAP | Components | Free | 2 deps | |
| Modal Ability Selectorai-token-counter | PaceUI GSAP | Components | Free | 2 deps | |
| Animated Stackanimated-stack | PaceUI GSAP | Components | Free | 2 deps | |
| Bouncing Textbouncing-text | PaceUI GSAP | Components | Free | 2 deps | |
| Dot Flowdot-flow | PaceUI GSAP | Components | Free | 2 deps |
