Wallet Stack, animated React component
Payment cards tucked into a leather wallet, each peeking out a little higher than the one in front. Picking a card slides it out while the others sink, then turns it over in 3D to show the back; picking it again puts it away.
- Pro
- Cards
- Hover
- Spring
- 3D
Play with it
Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.
Pick a card.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| cards | WalletCard[] | DEFAULT_WALLET_CARDS | Cards from back to front, each { id, name, last, bg, ink, brand, expires? }. Four fit best. |
| label | string | "Wallet" | Word stamped on the wallet; also the group's accessible name. |
| hint | string | "Pick a card." | Hint under the wallet. An empty string hides it. |
| onSelect | (id: string | null) => void | — | Called with the card id when one slides out, and null when it is put back. |
| autoplay | boolean | false | Takes each card out, flips it and puts it back in turn until someone touches it. |
| className | string | — | Extra classes for the root. |