Scroll stackPro
Cards that stick and stack as you scroll, earlier ones shrinking into the pile.
pnpm dlx shadcn@latest add @lode/scroll-stackScroll inside this box ↓
Install
One CLI command adds the component and its dependencies.
Customize
It's your code: change the tokens, props and markup freely.
Ship
Accessible, responsive and animated out of the box.
Iterate
Pull updates from the registry whenever you like.
When to use
- Feature or step stories on landing pages.
When not to use
- Content people need to compare: they overlap.
Installation
pnpm dlx shadcn@latest add @lode/scroll-stackPro components need an API key and the registry in components.json. See CLI and API keys.
1Install the dependencies
npm install motion2Copy the source into your project
Usage
Import it from @/components/ui/scroll-stack after installing.
import { ScrollStack } from "@/components/ui/scroll-stack";
<ScrollStack cards={steps.map((s) => <StepCard key={s.id} step={s} />)} top={80} cardHeight={360} />API reference
ScrollStack
Sticky cards that stack; earlier cards scale down and darken.
cards
ReactNode[]
Card contents.
container
RefObject<HTMLElement>
Scrollable element; omit for the page.
top / cardHeight= 24 / 320
number
Sticky offset and card height.
| Prop | Type | Default | Description |
|---|---|---|---|
| cards | ReactNode[] | – | Card contents. |
| container | RefObject<HTMLElement> | – | Scrollable element; omit for the page. |
| top / cardHeight | number | 24 / 320 | Sticky offset and card height. |
Accessibility
- Cards are normal content in reading order; nothing is hidden from assistive tech.
Motion
- Scale and dimming are tied to scroll position, so they follow your scroll exactly.
Responsive behavior
- Works at any width; keep cardHeight under the viewport height.
Performance
- Transforms driven by one scroll motion value.
Notes for AI
- Add space after the stack so the last card can settle.
This page as Markdown, for assistants and coding agents:
/components/scroll-stack/markdownThe full library index for assistants is at /llms.txt.
Related
Lode·229 doc pages·llms.txt