Paper Folding Animation with React Native Skia
Tuesday, July 30, 2024
Try the live demo
Scan to try on your device
Need the app?
demos
paper-folding
An ongoing collection of React Native animations crafted with Reanimated, Gesture Handler, and Skia.
TypeScript
3.2k
296
A paper folding animation component with touch interaction.
What's This About?
This component creates an interactive paper folding animation that responds to touch events. When touched, a paper-like element smoothly transitions between folded and unfolded states, creating a realistic folding effect. The component includes a gradient background that enhances the visual depth of the animation, making the paper appear to float above the surface.
Technical Implementation
The component uses:
Touch handling
Timing animations
Gradient backgrounds
Paper folding effects
Dimension control
Usage
// Basic usage
<PaperFolding />;
// Component configuration
const PaperWidth = 250;
const PaperHeight = 330;
// Animation control
const progress = useSharedValue(0);
// Paper component with props
<Paper width={PaperWidth} height={PaperHeight} progress={progress} />;
// Animation trigger
progress.value = withTiming(progress.value > 0 ? 0 : 1, {
duration: 800,
});
Unlock the beauty of React Native animations
Learn Reanimated, Gesture Handler & Skia with Reanimate.dev
Feedback on Paper Folding
Ideas, bugs, or anything that felt off: I read every message. For anything else, write to hello@reactiive.io.
Send feedback