# Swipe Deck — React Native component for Expo

> A card stack you swipe left or right; the top card leans in 3D and stamps a label.

A stack of photo cards you swipe left or right — the top card follows your finger, leans in 3D, washes green or red and stamps SAVE / SKIP, then flies off as the next card rises. Flick momentum, undo, and a ref for buttons.

- Docs: https://expokit.in/docs/components/swipe-deck
- Tier: Pro (ExpoKit Pro plan)
- Also called: Tinder-style card swiper, swipe cards, Tinder swipe
- Category: 3D
- Platforms: iOS, Android, web
- Expo Go: yes, no development build needed
- Uses ExpoKit items: kit
- Variants: Stays, People, Recipes

## Installation

This component is part of ExpoKit Pro. With a Pro plan, log the CLI in once and add it like any other item:

```bash
npx @expokit/cli@latest login
```

Plans: https://expokit.in/pricing

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `data` | `T[]` | — | Items, one card each (top first). |
| `renderItem` | `(item: T, index: number) => ReactNode` | — | Render a card. |
| `keyExtractor` | `(item: T, index: number) => string` | `index` | React key for each card. |
| `height` | `number` | `380` | Card height. |
| `onSwipe` | `(direction, item, index) => void` | — | Fires when a card leaves, with "left" or "right". |
| `index / onIndexChange` | `number / (index) => void` | `— / —` | Controlled top card; a fresh batch (first key changed) starts from the top on its own. |
| `disabled` | `boolean` | `false` | Swiping off (e.g. out of likes). |
| `onEmpty` | `() => void` | — | Fires once every card is gone. |
| `renderEmpty` | `() => ReactNode` | — | Shown when the deck is empty. |
| `rightLabel / leftLabel` | `string \| null` | `labels.like / labels.nope` | Stamp shown while dragging; null hides it. |
| `rightColor / leftColor` | `string` | `theme success / danger` | Stamp colours. |
| `stack` | `number` | `2` | Cards visible behind the top one. |
| `radius` | `number` | `24` | Corner radius of each card. |
| `ref` | `{ swipe(direction), undo() }` | — | Throw the top card from a button, or bring the last one back; reset() starts again from the first card. |
| `style` | `StyleProp<ViewStyle>` | — | Style for the root view. |
| `className` | `string` | — | Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. |

## Behaviour & accessibility

- **Touch**: Drag the top card past the threshold or flick it to throw it off; a short drag springs back. A ref exposes swipe, undo and reset for buttons.
- **Motion**: The card follows your finger, rotates and tilts in 3D, washes in the right or left colour and shows the stamp, while the next card rises.
- **Screen readers**: Only the top card is exposed. It offers the right and left labels as accessibility actions, which throw the card that way.

## FAQ

### How do I make a Tinder-style card swiper in React Native?

Use ExpoKit's Swipe Deck, a Pro component: with ExpoKit Pro, the ExpoKit CLI copies a ready-made Tinder-style card swiper into your Expo or React Native app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.

### Does Swipe Deck work in Expo Go?

Yes. Swipe Deck runs in Expo Go on iOS and Android with no development build.

### How do I add Swipe Deck to my Expo app?

With ExpoKit Pro, add it with the ExpoKit CLI: it copies the component's source into your app, so the code is yours to change. The install command is on this page for Pro members.

### Is Swipe Deck free?

Swipe Deck is part of ExpoKit Pro. With a Pro plan, log the CLI in once and it installs the full source into your app.

## More

- Live preview, variants and code: https://expokit.in/docs/components/swipe-deck
- Every ExpoKit component, screen, template and chart: https://expokit.in/llms.txt
- Install commands and props for every free component: https://expokit.in/llms-full.txt
- Pricing: https://expokit.in/pricing
