Skip to Content
Kokonut UI

CD-02Cards

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
lucide-react, motion

PROOnboarding Checklist and more like it are in Kokonut UI Pro

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.

npx shadcn@latest add @kokonutui/card-stack

Or add it by hand: install its packages, then copy the source from Copy code 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

cards
DeckCard[]Default built-in
accent
stringDefault "#f97316"

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

actionLabel
stringDefault "Add to cart"

Label of the primary action in the details view.

onAction
(card: DeckCard) => void
onChange
(card: DeckCard) => void

Called with the new top card after the deck cycles.

className
string

Extra classes for the root element.

DeckCard

idrequired
string
titlerequired
string
subtitlerequired
string
artrequired
ReactNode

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

descriptionrequired
string
specsrequired
DeckSpec[]
price
string

DeckSpec

labelrequired
string
valuerequired
string

Dependencies

NeedsVersionComes from
lucide-react^0.556.0npm, installed by the CLI
motion^12.23.25npm, installed by the CLI
cn from lib/utils.tsshadcn init
React19Your app
Tailwind CSS4Your app

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