Lesson 7 of 9
Micro-Interactions - Tactile Polish
Micro-interactions are the small, purposeful animations that make an app feel premium. A heart bounce on like, a checkmark drawing animation on task complete, a ripple on button press. Each takes 10 minutes to implement and makes the app feel 10x more polished.
Like Heart Animation
import Animated, { useSharedValue, useAnimatedStyle, withSequence, withTiming, withSpring } from 'react-native-reanimated';
import * as Haptics from 'expo-haptics';
function LikeButton({ initialLiked = false }: { initialLiked?: boolean }) {
const [liked, setLiked] = React.useState(initialLiked);
const scale = useSharedValue(1);
const rotate = useSharedValue(0);
const animatedStyle = useAnimatedStyle(() => ({
transform: [
{ scale: scale.value },
{ rotate: `${rotate.value}deg` },
],
}));
async function handlePress() {
// Haptic
await Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
// Animation sequence
scale.value = withSequence(
withTiming(0.7, { duration: 80 }), // squish
withSpring(1.4, { damping: 4, stiffness: 400 }), // bounce out
withSpring(1, { damping: 8, stiffness: 200 }) // settle
);
rotate.value = withSequence(
withTiming(-15, { duration: 80 }),
withSpring(0, { damping: 4 })
);
setLiked(l => !l);
}
return (
<Pressable onPress={handlePress} accessibilityRole="button" accessibilityLabel={liked ? 'Unlike' : 'Like'} accessibilityState={{ checked: liked }}>
<Animated.Text style={[{ fontSize: 28 }, animatedStyle]}>
{liked ? 'โค๏ธ' : '๐ค'}
</Animated.Text>
</Pressable>
);
}
// ---- Skeleton loading animation ----
function SkeletonCard() {
const shimmer = useSharedValue(0);
React.useEffect(() => {
shimmer.value = withRepeat(withTiming(1, { duration: 1200 }), -1, true);
}, []);
const shimmerStyle = useAnimatedStyle(() => ({
opacity: interpolate(shimmer.value, [0, 0.5, 1], [0.4, 0.8, 0.4]),
}));
return (
<View style={{ padding: 16, gap: 10 }}>
<Animated.View style={[{ height: 14, width: '70%', backgroundColor: '#1e293b', borderRadius: 7 }, shimmerStyle]} />
<Animated.View style={[{ height: 14, width: '90%', backgroundColor: '#1e293b', borderRadius: 7 }, shimmerStyle]} />
<Animated.View style={[{ height: 14, width: '55%', backgroundColor: '#1e293b', borderRadius: 7 }, shimmerStyle]} />
</View>
);
}Tip
Tip
Practice MicroInteractions Tactile Polish in small, isolated examples before integrating into larger projects. Breaking concepts into small experiments builds genuine understanding faster than reading alone.
Delighting users with springy buttons, like heart explosions, and tactile haptics
Practice Task
Note
Practice Task - (1) Write a working example of MicroInteractions Tactile Polish from scratch without looking at notes. (2) Modify it to handle an edge case (empty input, null value, or error state). (3) Share your solution in the Priygop community for feedback.
Quick Quiz
Common Mistake
Warning
A common mistake with MicroInteractions Tactile Polish is skipping edge case testing - empty inputs, null values, and unexpected data types. Always validate boundary conditions to write robust, production-ready react native code.
Finished this lesson?