Bézier Curve Outline with React Native Skia
Tuesday, November 5, 2024
demos
bezier-curve-outline
An ongoing collection of React Native animations crafted with Reanimated, Gesture Handler, and Skia.
TypeScript
3.2k
296
An elegant animation that demonstrates the power of Bézier curves with interactive outlines. Features smooth transitions between normal and outline modes, with dynamic blur effects and color interpolation.
What's This About?
This component creates an interactive animation where a square moves along a Bézier curve path. When activated, it transitions into an outline mode with beautiful blur effects and color transitions. The animation includes smooth scaling and movement along the curve.
Technical Implementation
The component leverages Skia for high-performance path rendering and Reanimated for fluid animations. It features:
Smooth spring animations for transitions
Path-based movement with progress tracking
Dynamic blur intensity
Color interpolation for status bar and text
Gesture-based interactions
Usage
// The component is self-contained and can be used directly
<BezierCurveOutline />;
// Core animation values
const outlineMode = useSharedValue(false);
const blurIntensity = useSharedValue(0);
const skiaPath = useSharedValue(Skia.Path.Make());
// Animation hook for path movement
const { progress, startAnimation, reverseAnimation } = useAnimateThroughPath({
pathReference: skiaPath,
});
Unlock the beauty of React Native animations
Learn Reanimated, Gesture Handler & Skia with Reanimate.dev
Feedback on Bezier Curve Outline
Ideas, bugs, or anything that felt off: I read every message. For anything else, write to hello@reactiive.io.
Send feedback