foontofoonto

Component

Stack Cards

A wallet-style card stack — swipe up or tap to cycle.

How to use

Minimal, copy-pasteable code.

Wallet.tsx
import { StackCards } from "react-native-foonto";
import { View, Text } from "react-native";

const CARDS = [
  { id: "1", name: "Platinum", color: "#6d28d9" },
  { id: "2", name: "Travel", color: "#0ea5e9" },
  { id: "3", name: "Cashback", color: "#16a34a" },
];

export function Wallet() {
  return (
    <StackCards
      data={CARDS}
      cardHeight={200}
      renderCard={(item) => (
        <View style={{ flex: 1, borderRadius: 20, padding: 20, backgroundColor: item.color }}>
          <Text style={{ color: "#fff", fontSize: 22, fontWeight: "800" }}>{item.name}</Text>
        </View>
      )}
    />
  );
}

Props

PropTypeDefaultDescription
datareqT[]Items to stack.
renderCardreq(item: T, index: number) => ReactNodeRender one card's content.
visibleCountnumber3How many cards are visible in the stack.
offsetnumber18Vertical offset (px) between stacked cards.
scaleStepnumber0.06Scale reduction per card deeper in the stack.
cardHeightnumber200Fixed card height in px.
onCycle(frontIndex: number) => voidFired when the front card changes.
styleFoontoStyleStyle for the stack container.

AI prompt

Install the library, then paste this into your AI coding agent to wire it up.

AI prompt
Add a wallet-style card stack using the `react-native-foonto` library.

1. Make sure `react-native-foonto`, `react-native-reanimated`, and `react-native-gesture-handler` are installed and the app root is wrapped in `<GestureHandlerRootView>`.
2. Import `StackCards` from `react-native-foonto`.
3. Pass a `data` array and a `renderCard` returning a styled card View.
4. Set `cardHeight`, and optionally `visibleCount` to control stack depth.
5. The front card flies up and tucks to the back on swipe-up or tap — set `visibleCount` to your data length if you want every layer visible.