maitrungduc1410/react-native-shared-hero — explained in plain English
Analysis updated 2026-05-18
Animate an image expanding from a list into a detail screen
Add hero transitions to native modals and form sheets
Sync a flying element's position with swipe-back gestures in real time
Choose between snapshot crossfade or morph transition styles
| maitrungduc1410/react-native-shared-hero | rryam/relatokit | appeight/app8-ios-sdk | |
|---|---|---|---|
| Stars | 26 | 26 | 25 |
| Language | Swift | Swift | Swift |
| Setup difficulty | moderate | moderate | moderate |
| Complexity | 3/5 | 2/5 | 4/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires React Native's New Architecture (Fabric), does not work with the older Paper architecture, and Expo users need a development build.
react-native-shared-hero is a library for React Native apps that animates a shared element as it flies between two different screens. This effect, often called a hero transition, is when you tap an image in a list and that image appears to expand and glide into its position on the detail screen. The library handles the animation entirely in native code, using Swift on iOS and Kotlin on Android, so the movement runs on the device's native thread rather than through JavaScript, keeping it smooth under load. The library works with any navigation setup. Instead of tying itself to a specific router, it matches elements on the source and destination screens by a shared id you assign in your code. When a screen change happens, the library detects matching ids, takes a snapshot of the element, and flies it in a window-level overlay that sits above everything else, including modals and sheets, until it settles in the new position. It supports a range of use cases beyond a simple image expanding into a detail view. You can use it with native modals, form sheets, tab transitions, virtualized lists, and plain state toggles within a single screen. Two animation styles are available: snapshot mode, which clones the element and crossfades between the original and destination views, and morph mode, which also animates corner radius and background color for a smoother container-style transition. On iOS, the library tracks the left-edge swipe-back gesture and the sheet swipe-down dismiss gesture frame by frame, syncing the flying element's position with the ongoing gesture in real time. Animation timing can be configured as a physical spring or a duration-based curve with easing presets, and motion paths can be linear or arc-shaped. The library requires React Native's New Architecture (Fabric) to be enabled. It does not work with the older Paper architecture. Expo users need a development build rather than Expo Go, since the library contains custom native code on both platforms.
A React Native library that animates shared elements flying smoothly between screens using native iOS and Android code.
Mainly Swift. The stack also includes React Native, Swift, Kotlin.
The README does not specify license terms for reuse of the code.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.