Throw Deck - React Component | Kokonut UI

Throw Deck

A pile of image cards you drag, flick off the top and send under the deck, with arrow keys and a details view.

Install with

npx shadcn@latest add https://kokonutui.com/r/card-stack.json,

then show me how to use it.

Installation

Throw Deck is a free, open-source React component in the Kokonut UI Cards collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/card-stack.tsx, so the code is yours to change.

Or add it by hand: install its packages, then copy the source from above into components/kokonutui/card-stack.tsx.

npm install lucide-react motion

Usage

import CardStack from "@/components/kokonutui/card-stack";

export default function Example() {
  return <CardStack />;
}

Props

The one accent color, used by the artwork and the primary action.

Label of the primary action in the details view.

Called with the new top card after the deck cycles.

Extra classes for the root element.

DeckCard

Artwork shown edge to edge on the card. Inline SVG keeps it portable.

DeckSpec

Dependencies

Needs Version Comes from
lucide-react ^0.556.0 npm, installed by the CLI
motion ^12.23.25 npm, installed by the CLI
cn from lib/utils.ts shadcn init
React 19 Your app
Tailwind CSS 4 Your app

No provider, font or global CSS to set up: the file works as soon as it lands.