# Card Stack — React Native component for Expo

> A Wallet-style stack that fans open on tap and slides the picked card to the front.

A Wallet-style stack: cards sit behind each other in 3D depth, fan open on tap, and the one you pick slides to the front as the stack closes. Works for payment cards, passes and notification piles.

- Docs: https://expokit.in/docs/components/card-stack
- Tier: Pro (ExpoKit Pro plan)
- Also called: stacked card wallet, stacked cards, card fan
- Category: 3D
- Platforms: iOS, Android, web
- Expo Go: yes, no development build needed
- Uses ExpoKit items: kit
- Variants: Wallet, Passes, Lock Screen

## 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. |
| `renderItem` | `({ item, index, front }) => ReactNode` | — | Render a card. `front` is true for the card in front. |
| `keyExtractor` | `(item: T, index: number) => string` | `index` | React key for each card. |
| `cardHeight` | `number` | `190` | Card height. |
| `peek` | `number` | `14` | How much of each card shows behind the front one when closed. |
| `spread` | `number` | `64` | Space between cards when open. |
| `depth` | `number` | `3` | Cards visible behind the front one when closed. |
| `selected` | `number` | — | Controlled front card (index into data). |
| `onPressFront` | `(index) => void` | — | Tap on the front card while closed (pay with it); the cards behind still open the stack. |
| `getAccessibilityLabel` | `(item, index) => string` | `"Card 2 of 4"` | Screen-reader label for each card. |
| `defaultSelected` | `number` | `0` | Uncontrolled initial front card. |
| `onSelect` | `(index: number) => void` | — | Fires when a card is picked. |
| `open` | `boolean` | — | Controlled open state. |
| `onOpenChange` | `(open: boolean) => void` | — | Fires when the stack opens or closes. |
| `radius` | `number` | `18` | Corner radius of each 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**: Tap the closed stack to fan it open, then tap a card to bring it to the front as the stack closes. With onPressFront, a tap on the front card calls it instead.
- **Motion**: Cards behind the front one shrink and tilt back in 3D depth. Opening, closing and reordering all run on springs.
- **Screen readers**: Each card is a button with selected and expanded state, labelled "Card 2 of 4" by default or by getAccessibilityLabel.

## FAQ

### How do I make a stacked card wallet in React Native?

Use ExpoKit's Card Stack, a Pro component: with ExpoKit Pro, the ExpoKit CLI copies a ready-made stacked card wallet 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 Card Stack work in Expo Go?

Yes. Card Stack runs in Expo Go on iOS and Android with no development build.

### How do I add Card Stack 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 Card Stack free?

Card Stack 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/card-stack
- 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
