Basic Usage
Configuration
overlay
Function that returns a React Element to display as an overlay. The overlay receives animation values and navigation state as props.
overlayShown
Whether to show the overlay. The overlay is shown by default when
overlay is provided. Set to false to hide the overlay for specific screens.Overlay Props
Overlay components receive the following props:focusedRoute
Route object of the currently focused screen in the stack.
focusedIndex
Index of the focused route in the stack (0-based).
routes
All routes currently in the stack.
progress
Stack progress relative to the overlay’s position. Equivalent to
useScreenAnimation().stackProgress.Use this for animating the overlay based on navigation state.meta
Custom metadata from the focused screen’s options.
navigation
Navigation prop for the overlay. Type depends on which stack you’re using (Blank, Native, or Component).
options
Screen options for the currently focused screen.
Examples
Animated Tab Bar
Music Player Overlay
Conditional Overlay with Meta
Stack Depth Indicator
Using useScreenAnimation in Overlays
You can also useuseScreenAnimation() inside overlay components for more complex animations:
Best Practices
Use progress for Animations
The
progress prop is optimized for overlay animations. Use it with useAnimatedStyle to create smooth, performant animations.Control Visibility with overlayShown
Instead of conditionally rendering overlays, use
overlayShown to control visibility. This maintains overlay state across screen transitions.Pass Data with meta
Use the
meta option to pass custom data to overlays. This is more type-safe and maintainable than global state for overlay configuration.Position Absolutely
Overlays should use absolute positioning to float above screen content. Use safe area insets for proper spacing on notched devices.
