React Native Metaball Animation ๐
Wednesday, March 1, 2023
Try the live demo
Scan to try on your device
Need the app?
demos
metaball
An ongoing collection of React Native animations crafted with Reanimated, Gesture Handler, and Skia.
TypeScript
3.2k
296
An interactive metaball effect with gradient colors and touch gestures.
What's This About?
This component creates an engaging metaball visualization where two circular shapes blend together with a fluid-like effect. Users can interact with both circles through touch gestures, creating dynamic blending animations. The implementation features a gradient color effect and blur transformations to achieve a smooth, liquid-like appearance that responds naturally to user interaction.
Technical Implementation
The component uses:
Skia for rendering
Gesture handling
Path manipulation
Color matrices
Gradient effects
Usage
// Basic usage
<Metaball />;
// Component configuration
const RADIUS = 80;
// Gesture setup
const circleGesture = useGestureHandler({
onStart: () => {
// Handle gesture start
},
onActive: ({ translationX, translationY }) => {
// Handle active gesture
},
});
// Visual effects
<Paint>
<Blur blur={30} />
<ColorMatrix
matrix={[1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 60, -30]}
/>
</Paint>;
Unlock the beauty of React Native animations
Learn Reanimated, Gesture Handler & Skia with Reanimate.dev
Feedback on Metaball
Ideas, bugs, or anything that felt off: I read every message. For anything else, write to hello@reactiive.io.
Send feedback