Skip to main content

Render props

Pass a render function to frontComponent or backComponent to receive these values.

type AnimatedCardFaceRenderProps = {
width: number;
height: number;
orientation: CardOrientation;
radius: number;
tiltX: SharedValue<number>;
tiltY: SharedValue<number>;
maxTiltDeg: number;
lightingType: LightingType;
showTexture: boolean;
flipLeft: () => void;
flipRight: () => void;
};

Common Values​

ValueDescription
width, heightResolved card size
orientationCurrent card orientation
radiusCard radius
tiltX, tiltYReanimated SharedValue tilt values
flipLeft, flipRightManual flip helpers

Compose Lighting Directly​

You can pass tiltX and tiltY directly to CardLighting.

import { Canvas } from '@shopify/react-native-skia';
import { CardLighting, LightingType } from '@0610studio/expo-holographic-card';

frontComponent={({ width, height, tiltX, tiltY, maxTiltDeg }) => (
<Canvas style={{ width, height }}>
<CardLighting
type={LightingType.Etched}
width={width}
height={height}
tiltX={tiltX}
tiltY={tiltY}
maxTiltDeg={maxTiltDeg}
/>
</Canvas>
)}