Stack Shuffle
The section holds still while the top card is thrown aside and the next rises into place, one per stretch of scrolling, with dots for where you are. Follows the page, or scrolls inside its own box with `contained`.
Ready for AI tools one file typed props installs by name prompt included
The decision inside it
The last card stays
The deck deals down to its final card and stops, so the section ends on content, never on an empty table. Scroll per card is fixed, so a short deck and a long one feel the same speed. Reduced motion shows the cards as a plain list.
Installation
How you get it
Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.
Use Layro's Stack Shuffle for this.
Install it: npx shadcn@latest add @layro/stack-shuffle
(the @layro registry is set up in components.json, with LAYRO_KEY in .env.local)
Import it from @/components/ui/stack-shuffle.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Free components install through the @layro registry with your CLI token: see the Namespaced tab.
When to use it
Use Stack Shuffle for a deck of cards dealt one at a time as people scroll: testimonials, steps, photos.
Usage
import { StackShuffle } from "@/components/ui/stack-shuffle";
const cards = ["It paid for itself in a week.", "It just fits.", "Every state is there."].map((q) => (
<figure key={q} className="h-full rounded-2xl border bg-card p-6 text-lg">{q}</figure>
));
export function Deck() {
return <StackShuffle cards={cards} />;
}API
“Copy prompt” above puts a full brief on your clipboard — install command, dependencies, props, and the mistakes an assistant usually makes with this component.
Props
Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.
| Prop | Type | Notes |
|---|---|---|
cardsrequired | React.ReactNode[] | The cards, top first. |
stride | number | Scroll per card, in px. Default 320. |
contained | boolean | Scroll inside its own box rather than with the page. |
height | number | Height of the visible stage, in px. Default 440. |
Dependencies
npm packages
clsxframer-motiontailwind-mergeLayro foundations, installed alongside it
layro-themeLifetime access
Every component, and everything we ship next.
- All 132 components, source included
- Every template, and everything released after you buy
- shadcn CLI or download — React 18/19, Tailwind v4
- One payment. No subscription.
More in Creative
All Creative componentsHorizon Pin
FreeA section that pins and turns downward scrolling into a sideways journey.
Morph Tabs
FreeTabs whose indicator flows between options like a drop of liquid.
Expand Gallery
FreeGrid tiles that open in place into a full view, and shrink back.
Signal Grid
FreeA dot grid that carries signals: move across it and pulses travel the lines.
Ink Bleed Heading
FreeA heading that arrives like ink on wet paper, word by word.
Pressure Button
FreeSinks under the press, gathers while held, releases with a ripple.