Overview
Masked View is required for reveal-style transitions likeSharedIGImage and SharedAppleMusic presets. The mask creates a “reveal” effect where content expands from the shared element bounds.
Installation
Complete Implementation
Here’s a full example showing all three parts: source screen, destination screen, and layout configuration.Tag the source element
Create a pressable element with a
sharedBoundTag:The
Transition.Pressable measures its bounds on press and stores them with the tag.Wrap destination with MaskedView
Use
Transition.MaskedView and match the tag on the destination element:The
Transition.MaskedView clips content to the animating shared element bounds, creating the reveal effect.How It Works
The masked view transition works in four stages:- Source Press:
Transition.Pressablemeasures its layout bounds and stores them with thesharedBoundTag - Navigation: User navigates to the destination screen
- Target Registration:
Transition.Viewon the destination registers as the target for that tag - Mask Animation:
Transition.MaskedViewclips content to animate smoothly between source and target bounds
Available Presets
These presets requireTransition.MaskedView:
SharedAppleMusic
SharedAppleMusic
SharedIGImage
SharedIGImage
Troubleshooting
Error: MaskedView not found
Error: MaskedView not found
Make sure you’ve installed
@react-native-masked-view/masked-view and rebuilt your app:Transition appears but no reveal effect
Transition appears but no reveal effect
Ensure:
- Source has
sharedBoundTagonTransition.Pressable - Destination has matching
sharedBoundTagonTransition.View - Destination content is wrapped in
Transition.MaskedView - Layout uses a preset that supports bounds (like
SharedAppleMusic)
Content appears instantly, no animation
Content appears instantly, no animation
Check that:
- The
sharedBoundTagmatches between source and destination - The preset is correctly applied in screen options
- The source element was pressed (not programmatically navigated without interaction)
Does not work in Expo Go
Does not work in Expo Go
This is expected. MaskedView requires native code compilation:
Related Resources
- Shared Elements - Full bounds API documentation
- Presets - All available transition presets
- Custom Animations - Build your own masked transitions
