Scroll Stack
Fan stack
Fan stack
Three numbered steps dealt from a pile into a cascade as you scroll.
scrollerRef- points the scroll trigger at the box it scrolls in. Leave it out on a normal page and the window drives the deal.
tone- on a card picks its surface —
muted,lightoraccent, all tinted from your primary colour. By default the cards step through them in order. side- on
FanStackThumbhangs the photo off the card'sright,leftortopedge in the cascade.
prefers-reduced-motion the cascade simply shows, without the deal.Installation
New project? Follow the installation guide to set up Tailwind CSS, shadcn, the cn helper and lucide-react, register the @algorize-ui registry once, then copy your styles from the Themes page.
Two builds, same props and file — install one.
Install Fan Stack
components/ is written into your project. Copy any snippet from a Usage tab above and it runs.
Install dependencies
Step 1 installs this for you. Run it yourself only if you are adding Fan Stack to an existing project by hand. The cn helper and lucide-react are not listed — the installation guide covers them once for every component.
gsap is an npm package.
Simple stack
Card gap
cardGap{64}- is the pixel offset between stacked cards, which is what keeps the titles underneath readable.
color"#1e3a8a"- on a StackItem sets its unique background color (supports hex codes, CSS colors, or Tailwind classes).
Installation
Install Scroll Stack
components/ is written into your project. Copy any snippet from a Usage tab above and it runs.
Install dependencies
Nothing beyond the shared setup — Scroll Stack needs only the cn helper and lucide-react, which the installation guide already put in place.
Sticky stack
Sticky stack
A headed section where each card sticks and the next overlaps it.
contentType- on an item picks its body:
list,image,splitorcustom.
Installation
Two builds, same props and file — install one.
Install Sticky Scroll Stack
components/ is written into your project. Copy any snippet from a Usage tab above and it runs.
Install dependencies
Step 1 installs this for you. Run it yourself only if you are adding Sticky Scroll Stack to an existing project by hand. The cn helper and lucide-react are not listed — the installation guide covers them once for every component.
gsap is an npm package.
More examples
Stack geometry
scaleStep{0.08}- is how far each covered card recedes.
stackOffsetStep{28}- is the pixel offset that keeps earlier headers peeking out.
Split stack
Pinned right
A two-column layout: the right column pins while the left scrolls its deck past it.
stickySide"right"- pins the right-hand column so cards stack on the right.
Installation
Install Split Scroll Stack
components/ is written into your project. Copy any snippet from a Usage tab above and it runs.
Install dependencies
Nothing beyond the shared setup — Split Scroll Stack needs only the cn helper and lucide-react, which the installation guide already put in place.
More examples
Pinned left
- Flip
stickySide"left" - and the deck moves to the left side.
cardDepthScale- and
cardOffsettune that deck's shrink and spacing.
Horizontal Scroll Stack
The section pins and vertical scroll is translated into horizontal travel.
items- become the cards on the rail, in order.
Installation
Install Horizontal Scroll Stack
components/ is written into your project. Copy any snippet from a Usage tab above and it runs.
Install dependencies
Nothing beyond the shared setup — Horizontal Scroll Stack needs only the cn helper and lucide-react, which the installation guide already put in place.
More examples
Shorter Rail
items- slide continuously across the viewport without stacking.
HorizontalRail is its own item, so it installs on its own:Install Horizontal Rail
components/ is written into your project. Copy any snippet from a Usage tab above and it runs.
Install dependencies
Nothing beyond the shared setup — Horizontal Rail needs only the cn helper and lucide-react, which the installation guide already put in place.
Features
Fluid Animations
Hardware-accelerated transitions that ensure smooth 60fps performance across devices.
Highly Customizable
Exposes intuitive props for tailoring colors, sizes, and animation speeds to fit your brand.
Responsive Design
Automatically adapts to mobile, tablet, and desktop viewports without horizontal scrolling issues.
Accessible
Built with semantic HTML and ARIA labels where necessary to support screen readers and keyboard navigation.
Best Practices & Guidelines
Animation Performance
Avoid placing too many heavy animated components on a single screen to prevent layout thrashing and maintain 60fps performance. Use intersection observers to pause off-screen animations.
State Management
When triggering animations via state changes, ensure you wrap state updates in startTransition or use lightweight stores to prevent React rendering bottlenecks during the animation tick.
Props Reference
| Component / Interface | Prop | Type | Default | Description |
|---|---|---|---|---|
FanStack | children | ReactNode | Required | The FanStackCards, in order. Any number works; the cascade spreads them across the width. |
FanStack | scrollerRef | RefObject<HTMLElement | null> | window | The element that scrolls, when the stack sits inside a scroll container rather than the page. |
FanStack | scrub | number | 0.6 | Seconds the cards take to catch up with the scrollbar. 0 locks them to it. |
FanStack | stickyTop | number | 16 | Below 768px of width, the gap in px above the first stuck card. Raise it to clear a fixed header. |
FanStackCard | tone | "muted" | "light" | "accent" | By position | The card's surface, tinted from --primary. Cards step through the three in order when left unset. |
FanStackThumb | side | "right" | "left" | "top" | By position | Which edge the photo hangs off in the cascade. Below 768px of width it is a small photo in the card's top corner. |
FanStackPoint | icon | ReactNode | Check mark | Replaces the check mark ahead of the point. |
ScrollStack | items | StackItem[] | Required | An array of feature card objects defining the sequential stack
sequence. |
StackItem | color | string | undefined | Custom background color for this specific card. Accepts hex color codes (e.g. #1e3a8a), CSS colors (rgb, hsl), or Tailwind utility classes. |
ScrollStack | depthScale | number | 0.05 | Controls the scaling mathematics. A value of 0.05 means
each background card shrinks by 5% as the next card stacks over it via
GSAP. |
ScrollStack | cardGap | number | 24 | The vertical pixel distance applied to the sticky top offset of each
subsequent card, creating a staggered folder/deck appearance at the
top of the viewport. |
ScrollStack | scroller | string | Element | null | window | Optional scrolling viewport target passed directly to GSAP's
ScrollTrigger. Essential when rendering the stack inside
custom overflow containers, modals, or preview boxes instead of the
native window root. |
ScrollStack | className | string | undefined | Custom Tailwind CSS classes to apply to the outermost scrolling
container wrapper. |
StackItem | id | string | Required | A unique identifier string required for safe React list rendering and
GSAP key mapping. |
StackItem | title | string | Required | Primary headline text displayed prominently on the left or top side of
the card. |
StackItem | description | string | Required | Detailed paragraph text explaining the feature, displayed beneath the
headline. |
StackItem | icon | React.ElementType | undefined | Optional Lucide React icon rendered inside an adaptive badge box above
the title. |
StackItem | content | React.ReactNode | undefined | Optional custom JSX/UI payload (e.g., code blocks, interactive graphs,
mockups) rendered on the right half of the card on desktop viewports. |
StackItem | color | string | "bg-card border-border..." | Optional Tailwind background, text, and border classes applied to the
card surface (e.g., "bg-indigo-600 text-white"). Omitting
this allows the card to adapt automatically to light and dark modes. |