The Progress Model
All animations in Screen Transitions are driven by a progress value that ranges from 0 to 2:- 0 → 1: Screen is entering (becoming visible)
- 1 → 2: Screen is exiting (becoming hidden)
- Exactly 1: Screen is fully visible and in focus
- Screen B enters: progress 0 → 1
- Screen A exits: progress 1 → 2
Simple Fade Animation
Here’s the simplest custom animation — a fade in and out:interpolate function maps progress from [0, 1, 2] to opacity values [0, 1, 0]. At progress 0 (entering), opacity is 0. At progress 1 (visible), opacity is 1. At progress 2 (exiting), opacity is 0.
Slide from Right
Slide a screen in from the right edge:screenWidth (off-screen right), moves to 0 (visible), then slides left to -screenWidth as it exits.
Slide from Bottom
A common mobile pattern for modals:Return Format: Flat Styles
The return object uses a flat style structure. ReturncontentStyle and backdropStyle at the top level, plus any styleId keys:
content: { style: { ... } }. Always use the flat format.
Targeting Elements with styleId
UsestyleId on any component to target it in the interpolator:
Animation Specs
Define timing and physics for open/close/expand/collapse animations:- stiffness — How aggressively the spring pulls (default 100)
- damping — How quickly the spring settles (default 10)
- mass — Weight of the object (default 1)
Interpolator Props Reference
ThescreenStyleInterpolator function receives a single object with these properties:
| Prop | Type | Description |
|---|---|---|
progress | Animated Value | 0→1→2 progress of the current screen |
stackProgress | Animated Value | Overall stack progress (0 = first screen, 1 = fully nested) |
snapIndex | Animated Value | Current snap point index (0-based) |
focused | boolean | Is this screen focused? |
current | ScreenProgress | Current screen state |
previous | ScreenProgress | Previous screen state |
next | ScreenProgress | Next screen state |
active | ScreenProgress[] | All active screens (nested) |
inactive | ScreenProgress[] | All inactive screens |
layouts.screen | Current screen dimensions | |
insets | SafeAreaInsets | Safe area insets |
bounds | function | Bounds measurement API |
Screen State Properties
ScreenProgress objects have these properties:
| Property | Type | Description |
|---|---|---|
progress | Animated Value | Normalized 0→1→2 progress |
closing | boolean | Screen is closing |
entering | boolean | Screen is entering |
animating | boolean | Screen is animated |
gesture | GestureState | Active gesture data |
meta | object | Custom metadata |
Conditional Logic with meta
Pass metadata to interpolators and check it for conditional behavior:GestureState Properties
When a user is dragging, the gesture state includes:| Property | Type | Description |
|---|---|---|
isDragging | boolean | User is actively dragging |
x | Animated Value | X position |
y | Animated Value | Y position |
normalizedX | 0-1 | X as fraction of screen width |
normalizedY | 0-1 | Y as fraction of screen height |
isDismissing | boolean | Gesture is a dismiss |
direction | ”up” | “down” | “left” | “right” | Gesture direction |
Advanced: Conditional Animation
Respond to user gestures in real time:Next Steps
- Learn Gestures to make animations interactive
- Explore Snap Points for multi-stop animations
- Check out Shared Elements for bounds-based layouts
