Sticky Card Stack
Project cards that pin one over the next like a deck being dealt — each card shrinks back and dims as the following one slides up over it, still peeking out by a few pixels. Scroll-driven with sticky positioning, no layout JS.
Try it: Scroll the frame — each card pins while the next slides over it.
Installation
Install with the shadcn CLI:
npx shadcn@latest add https://www.framekitui.live/r/sticky-card-stack.jsonOr, with the @framekit namespace registered: npx shadcn@latest add @framekit/sticky-card-stack. You can also copy the source into components/ui/sticky-card-stack.tsx (view on GitHub).
Usage
import { StickyCardStack } from '@/components/ui/sticky-card-stack'Props
| Prop | Type | Default | Notes |
|---|---|---|---|
items | PortfolioProject[] | SAMPLE_PROJECTS (5) | Projects: { id, title, category, year, blurb, src?, seed?, tags?, href? }. Without src, generated art is drawn from seed. |
scrollContainer | RefObject<HTMLElement> | — | Scrolling element that holds the stack (defaults to the window). |
cardHeight | number | 380 | Height of each card in px. |
onSelect | (project) => void | — | Fires when a card is activated (renders a button when there is no href). |
titleAs | 'h2' | 'h3' | 'h4' | 'h3' | Heading element for titles. |
className | string | — | Extra classes merged onto the root. |
Dependencies
motionlucide-react
Related Cards components
- Feature Bento Grid
An asymmetric grid of feature tiles with generated art. Hover or focus a tile: it lifts, a hairline light follows the pointer around its edge, the art drifts up and a call-to-action rises. CTAs stay…
- Mesh Project Cards
Project cards headed by a living mesh gradient — drifting blurred blobs with film grain — and a status pill that pulses for live and in-progress work. Cards tilt toward the pointer with a travelling…
- Device Frame
Generic, logo-free device chrome for product shots: a browser with a frosted toolbar and centred address field, or a phone with a machined two-tone rim, punch-hole camera, status bar and floating…
- Book Spine Shelf
A shelf of generated book spines: the hovered book slides out while neighbours lean away, and choosing one swings its cover open on a hinge into a reading card with an optional ribbon. Arrow keys…
- Neon Halo Card
A card rimmed by a slow sweep of coloured light: a conic gradient travels a hairline edge while a soft bloom breathes behind it, and the pointer pulls a quiet spotlight across the surface.…
- Flip Checkout Card
Frosted payment card mirrors every keystroke, flips for the security code, and the checkout condenses into a receipt once paid.