# 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

```bash
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](/content/docs/cards/index.html). 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`.

```bash
npm install lucide-react motion
```

## Usage

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

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

## Props

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

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

- `actionLabel`
  - `string` Default `"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

- `id` required
  - `string`
- `title` required
  - `string`
- `subtitle` required
  - `string`
- `art` required
  - `ReactNode`

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

- `description` required
  - `string`
- `specs` required
  - `DeckSpec[]`
- `price`
  - `string`

### DeckSpec

- `label` required
  - `string`
- `value` required
  - `string`

## 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.
