Skip to content
All components
0:00/0:00

Gesture

Scratch Card

A gold-leaf scratch ticket. Rub the foil away with your finger and it tears, cracks and flakes like the real thing.

WebGPU + Skia + Reanimated + Gesture Handler

$12.99

Or get it with Pro

By buying you agree to the Terms and Licence. All sales are final.

Recorded on iPhone. Scratching the gold foil away to reveal a prize underneath.

Features

  • A solid gold ticket with a scalloped edge and engraved lettering
  • Scratch with your finger and the foil tears in sharp, shiny edges
  • Fine cracks, hanging flaps of leaf and falling gold dust
  • Scratch enough and a wave clears the rest, then the glow blooms
  • Tip the phone and the light moves across the metal
  • Hide anything underneath: it's your own view
  • Gold or silver foil, and your own words on the ticket
  • No flying leaf under Reduce Motion, just a gentle fade

Installation

1Install dependencies
npx expo install react-native-skia react-native-webgpu react-native-reanimated react-native-worklets react-native-gesture-handler expo-build-properties
2Add WebGPU and raise Android's minimum version in app.json
{
  "expo": {
    "plugins": [
      "react-native-webgpu",
      ["expo-build-properties", { "android": { "minSdkVersion": 26 } }]
    ]
  }
}
3Wrap your app in GestureHandlerRootView
import { Stack } from 'expo-router';
import { GestureHandlerRootView } from 'react-native-gesture-handler';

export default function RootLayout() {
  return (
    <GestureHandlerRootView style={{ flex: 1 }}>
      <Stack screenOptions={{ headerShown: false }} />
    </GestureHandlerRootView>
  );
}
4Run a development build (Expo Go can't load Skia or WebGPU)
npx expo run:ios   # or: npx expo run:android

Usage

import { StyleSheet, Text, View } from 'react-native';
import { ScratchCard } from '@/components/scratch-card';

export function Ticket() {
  return (
    <ScratchCard
      title="Good Luck"
      subtitle="Scratch to reveal"
      style={styles.card}
    >
      <View style={styles.prize}>
        <Text style={styles.text}>You won!</Text>
      </View>
    </ScratchCard>
  );
}

const styles = StyleSheet.create({
  card: { width: 260, aspectRatio: 0.72 },
  prize: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
    backgroundColor: '#4b2bb8',
  },
  text: { color: '#fff', fontSize: 28, fontWeight: '800' },
});

Whatever you pass as children is what the foil hides.

How it works

The foil is drawn by WebGPU shaders. Each stroke of your finger is stamped into a mask on the GPU, and the shaders read it to tear the edge, light it and crack it. The lettering is drawn once with Skia into a height map, so it stands up out of the metal. Pieces of leaf and dust that fly off are moved on the UI thread and drawn on their own canvas, which stops as soon as the last piece lands. Once enough is scratched and your finger lifts, a wave clears the rest.

More once you own it

Examples, the full list of props and every advanced option for Scratch Card are here for owners.

Next componentRolling Carousel
TesseraUI

Welcome back

Sign in to TesseraUI

Your purchases live in your account, so they open on every device you sign in on.

Sign-in isn’t available right now. Please try again in a moment.

By continuing you agree to the Terms, Licence and Privacy Policy.