$ git show spinner-arc
Arc spinner
The Material-style loader: an arc that spins while it stretches and shrinks.
// Reanimated 4: the rotation is a CSS animation; the arc stays on useAnimatedProps
import Svg, { Circle } from 'react-native-svg';
const AnimatedCircle = Animated.createAnimatedComponent(Circle);
const R = 18, C = 2 * Math.PI * R;
const spinKeyframes = { from: { transform: [{ rotate: '0deg' }] }, to: { transform: [{ rotate: '360deg' }] } };
const arc = useSharedValue(0);
useEffect(() => {
arc.value = withRepeat(withTiming(1, { duration: 700, easing: Easing.bezier(0.4, 0, 0.2, 1) }), -1, true);
}, []);
const props = useAnimatedProps(() => ({ strokeDashoffset: C * (0.95 - 0.7 * arc.value) }));
<Animated.View style={{
animationName: spinKeyframes,
animationDuration: '1600ms',
animationIterationCount: 'infinite',
animationTimingFunction: 'linear',
}}>
<Svg width={48} height={48} viewBox="0 0 48 48">
<AnimatedCircle cx={24} cy={24} r={R} fill="none" stroke="#2F54EB" strokeWidth={5}
strokeLinecap="round" strokeDasharray={C} animatedProps={props} />
</Svg>
</Animated.View>