Spring physics — natural, bouncy animations.
Basic spring:
1import { Animated } from "react-native";23const springAnim = useRef(new Animated.Value(0)).current;45Animated.spring(springAnim, {6 toValue: 1,7 friction: 7,8 tension: 40,9 useNativeDriver: true,10}).start();1112const scale = springAnim.interpolate({13 inputRange: [0, 1],14 outputRange: [0, 1],15});1617<Animated.View style={{ transform: [{ scale }] }}>18 <Text>Spring animation</Text>19</Animated.View>
Spring presets:
Parameters:
friction — damping (higher = less bounce).tension — stiffness (higher = faster).speed — animation speed.bounciness — bounce amount.