Scroll Transition with Reanimated and Skia
Wednesday, February 21, 2024
demos
3d-scroll-transition
An ongoing collection of React Native animations crafted with Reanimated, Gesture Handler, and Skia.
TypeScript
3.2k
296
This is a cool 3D scroll animation that creates an awesome visual effect when you scroll through a list of numbers. It's built using Reanimated and Skia.
What's This All About?
This animation creates a mesmerizing 3D effect where:
Numbers float in a vertical list
As you scroll, each number rotates in 3D space
Items blur and fade smoothly as they move away from the center
There's a beautiful gradient effect that makes everything pop!
How It Works
The magic happens through two main components:
ScrollTransition3D: The main component that:
Sets up a vertical scrolling list
Handles smooth scroll animations
Uses efficient native thread animations for buttery-smooth performance
Manages item sizing and layout
BlurredListItem: The individual items that:
Create that sweet 3D rotation effect
Handle blurring and opacity transitions
Apply a gorgeous gradient overlay
Use Skia for high-performance rendering
Technical Details
Uses react-native-reanimated for smooth animations
Leverages @shopify/react-native-skia for high-performance graphics
Implements smart performance optimizations like:
Worklet-based scroll handling
Efficient blur effects
Optimized window sizing
Smart item recycling
Implementation Notes
The animation uses windowSize=2 for optimal performance
Items snap into place thanks to snapToInterval
The blur effect is optimized to only apply when necessary
Everything runs on the native thread for maximum smoothness
Usage
Just import ScrollTransition3D and drop it into your app - it's that simple! The component will handle all the fancy 3D transitions and effects automatically.
Unlock the beauty of React Native animations
Learn Reanimated, Gesture Handler & Skia with Reanimate.dev
Feedback on 3d Scroll Transition
Ideas, bugs, or anything that felt off: I read every message. For anything else, write to hello@reactiive.io.
Send feedback