# Animations & Transitions

> Use declarative, native-thread animations to give feedback, show relationships between screens and guide attention without hurting frame rate. Free notes, key...

Canonical: https://www.internhack.in/roadmaps/tracks/mobile/animations
Last updated: 2026-11-28

Use declarative, native-thread animations to give feedback, show relationships between screens and guide attention without hurting frame rate.

Intermediate · about 7 hours · difficulty 3/5

Learn first: [Components, Props & Styling](https://www.internhack.in/roadmaps/tracks/mobile/components-and-styling), [Navigation Patterns](https://www.internhack.in/roadmaps/tracks/mobile/navigation)

Motion on mobile is functional: it confirms a tap, shows where a sheet came from, and hides loading. The rule of thumb is **short, purposeful and interruptible** (roughly 150 to 350 ms for most UI changes).

### The frame budget

Screens refresh 60 to 120 times a second, so each frame has about 16 ms (or 8 ms at 120 Hz). Animations that run on the JavaScript or main thread stutter whenever that thread is busy. Prefer engines that run animation work on the UI or render thread.

### Tools by stack

- **React Native:** **Reanimated** runs animations as worklets on the UI thread: `const x = useSharedValue(0); x.value = withSpring(100);` then read it in `useAnimatedStyle`. Layout animations (`entering`, `exiting`) animate mounts and unmounts. The built-in `Animated` API works with `useNativeDriver: true` for transform and opacity.
- **Flutter:** implicit widgets (`AnimatedContainer`, `AnimatedOpacity`) for simple cases, `AnimationController` plus `Tween` for explicit control, and `Hero` for shared elements.
- **Compose:** `animate*AsState`, `AnimatedVisibility`, `updateTransition` and `SharedTransitionLayout`.
- **SwiftUI:** `withAnimation { }`, `.animation(_:value:)`, `matchedGeometryEffect` and `PhaseAnimator`.

### What to animate

Animate **transform and opacity**, which are cheap. Animating width, height or layout triggers re-layout every frame. Use springs for natural motion, and respect the system **Reduce Motion** setting by shortening or removing non-essential animation.

### Vector animations

**Lottie** plays After Effects exports on every platform, handy for onboarding and empty states. Keep files small and avoid them in long lists.

**Good enough to move on:** you can animate a card expanding into a detail view at a steady frame rate and turn it off when Reduce Motion is on.

## Key concepts

- **Frame budget and UI thread**
- **Reanimated shared values**: React Native
- **Implicit vs explicit animations**
- **Layout and enter/exit animations**
- **Shared element transitions**
- **Spring physics and easing**
- **Reduce Motion support**
- **Lottie vector animations**

## Mini project

Build a product grid where tapping a card smoothly expands it into a detail screen, list items animate in on mount, and all motion is reduced when the system setting is on.

## Check yourself

Why does animating translateX usually stay smooth while animating width can drop frames, and what thread should an animation ideally run on?

## Free resources

- [React Native Reanimated](https://docs.swmansion.com/react-native-reanimated/) (Software Mansion)
- [Flutter: Introduction to animations](https://docs.flutter.dev/ui/animations) (Flutter)
- [Compose: Animations](https://developer.android.com/develop/ui/compose/animation/introduction) (Android Developers)

Previous: [Background Tasks & App States](https://www.internhack.in/roadmaps/tracks/mobile/background-work) · Next: [Gestures & Touch Interaction](https://www.internhack.in/roadmaps/tracks/mobile/gestures)

## More in Animations, Gestures & Performance

- [Animations & Transitions](https://www.internhack.in/roadmaps/tracks/mobile/animations)
- [Gestures & Touch Interaction](https://www.internhack.in/roadmaps/tracks/mobile/gestures)
- [Performance & Profiling](https://www.internhack.in/roadmaps/tracks/mobile/performance-profiling)
- [Startup Time & App Size](https://www.internhack.in/roadmaps/tracks/mobile/startup-and-app-size)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Mobile App Developer Roadmap](https://www.internhack.in/roadmaps/tracks/mobile)
