Card Pack
A foil pack of cards to open. Tear it along the top with your finger, or just click it: the foil rips along a ragged line, the torn strip curls back silver side up and follows your hand, then flies off as confetti bursts, the cards rise out and the pack drops away. They fan out face down and turn over in a wave, the rare one last, in holo foil, with its own burst.
How It Works
The pack is two pieces of the same foil that share one ragged tear line, so the strip's bottom and the body's top fit together exactly. The strip is cut into 40 slices, each showing its own part of the foil on the front and silver behind. Dragging sets how far the tear has run and how high the hand has lifted: behind the tear, every slice sits on a small cylinder that travels with it, so the torn part curls over and lies back on the strip, silver up, leaning toward the hand, while white fibres and a dark mouth open along the body. Past halfway, or on a click, it finishes the tear itself. Then a chain of animations runs: strip flung, rays and confetti, cards risen in a stagger, pack dropped, cards dealt all at once to a row (if it fits) or a fan, so none crosses another, and turned from their backs in an even wave that starts as they settle, the rare one last with a lift and a second burst. The cards stay hidden while a pack is sealed, so none can show round the next one as it rises. Once dealt, every card lifts by how near the pointer is, on a smooth bell-shaped falloff, so sliding across sends a wave through the hand; the card under the pointer also tilts toward it, all eased on one clock that rests once settled.
Use It
Install it with shadcn, or copy the file into your components folder, then use it like this. Works with Next.js (App Router) and any React 19 project on Tailwind CSS v4.
npx shadcn@latest add @reacthive/card-pack<div className="h-svh">
<CardPack packs={[{ name: "Bloom", color: "#e8237f", cards: [{ src, alt, name, no, rare }] }]} />
</div>- packs are opened one after another, each { name, color, cards }; color can be any CSS background, such as a gradient. Cards are { src, alt, name, no, tone?, rare? }; five per pack fit best, with the rare one last.
- It fills its parent. Cards deal into a row when five fit side by side, otherwise into a fanned hand spread as wide as the screen allows. --card and --pack set their widths, --pack-y how far down the stage the pack and the dealt cards sit (40% by default), --again the button colour.
- The pack is a button: Enter or Space opens it. What you got is announced to screen readers. With reduced motion everything happens at once, with no confetti or spin.
- No packages: the Web Animations API for the sequence and one small canvas for confetti, which only draws while pieces are in the air.
More Galleries

Morph Gallery
Galleries

Lean Strip
Galleries

Focus Grid
Galleries
Your Next Site Starts with a Live Demo.
Click around first. What you see is exactly what you download.