Gathering detailed insights and metrics for @reactrondev/react-navigation-fluid-transitions
Gathering detailed insights and metrics for @reactrondev/react-navigation-fluid-transitions
Gathering detailed insights and metrics for @reactrondev/react-navigation-fluid-transitions
Gathering detailed insights and metrics for @reactrondev/react-navigation-fluid-transitions
Fluid Transitions for React Navigation
npm install @reactrondev/react-navigation-fluid-transitions
Typescript
Module System
JavaScript (94.02%)
Objective-C (2.97%)
Java (1.69%)
Python (1.32%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
689 Commits
28 Branches
Updated on Sep 26, 2019
Latest Version
0.3.4
Package Id
@reactrondev/react-navigation-fluid-transitions@0.3.4
Unpacked Size
121.82 kB
Size
26.97 kB
File Count
62
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
4
This project aims to implement a simple yet powerful set of constructs for building fluid transitions between elements when navigating with React Navigation.
The library is JavaScript only - no linking required.
The library implements a new navigator component called FluidNavigator
with the same interface and routing configuration as the StackNavigator
. The library has a component called Transition
which can be used to build different types of transitions that will automatically be run when navigating between screens using the regular navigation actions.
The Navigator's API is identical to the StackNavigator except that it does not support a header component. It can easily be integrated with redux and your existing navigation setups.
Medium article
React Native Animation Challenge #1
To install the library into your project, run yarn or npm:
yarn add react-navigation-fluid-transitions
or
npm i -S react-navigation-fluid-transitions
Compatible versions with react-navigation
:
react-navigation-fluid-transitions | react-navigation |
---|---|
0.3.x | 3.x |
0.2.x | 2.x |
0.1.x | 1.x |
Future improvements and development will be on react-navigation-fluid-transitions@0.3.x.
Examples are included in the project and should be runnable from the root of the project folder.
To start the example run the following commands from the terminal:
npm i
or yarn
To start the project run
react-native run-ios
or react-native run-android
This example shows how two elements can be set up to automatically transition between each other when navigating between screens. A more detailed edition of this example can be found in the file SharedElements.js.
Note that a shared transition happens between two elements that looks the same. The library animates position and scale between the two hence using different styles and content between the two elements will result in strange transitions.
1const Screen1 = (props) => ( 2 <View style={styles.container}> 3 <Text>Screen 1</Text> 4 <View style={styles.screen1}> 5 <Transition shared='circle'> 6 <View style={styles.circle}/> 7 </Transition> 8 </View> 9 <Button 10 title='Next' 11 onPress={() => props.navigation.navigate('screen2')} 12 /> 13 </View> 14); 15 16const Screen2 = (props) => ( 17 <View style={styles.container}> 18 <Text>Screen 2</Text> 19 <View style={styles.screen2}> 20 <Transition shared='circle'> 21 <View style={styles.circle2}/> 22 </Transition> 23 </View> 24 <Button 25 title='Back' 26 onPress={() => props.navigation.goBack()} 27 /> 28 </View> 29); 30 31const Navigator = createFluidNavigator({ 32 screen1: { screen: Screen1 }, 33 screen2: { screen: Screen2 }, 34}); 35
The library also supports transitions for elements wrapped in the Transition
component. You can provide appear/disappear transitions that will be animated during navigation.
The Transition
element supports appear and disappear transitions (appear will be used if disappear is not set), and these can either be one of the predefined transitions - or functions where you provide your own transitions.
1<Transition appear='scale' disappear='bottom'> 2 <View style={styles.circle}/> 3</Transition>
Name | Description |
---|---|
scale | Scales the element in and out |
top | Translates the element in/out from the top of the screen |
bottom | Translates the element in/out from the bottom of the screen |
left | Translates the element in/out from the left of the screen |
right | Translates the element in/out from the right of the screen |
horizontal | Translates the element in/out from the left/right of the screen |
vertical | Translates the element in/out from the top/bottom of the screen |
flip | Flips the element in/out |
It is easy to provide custom transitions - just add the transition function to your component's appear or disappear property. The following example creates a transition that will scale in from 88 times the original size of the wrapped component:
1<Transition appear={myCustomTransitionFunction}> 2 <View style={styles.circle}/> 3</Transition> 4 5myCustomTransitionFunction = (transitionInfo) => { 6 const { progress, start, end } = transitionInfo; 7 const scaleInterpolation = progress.interpolate({ 8 inputRange: [0, start, end, 1], 9 outputRange: [88, 80, 1, 1], 10 }); 11 return { transform: [{ scale: scaleInterpolation }] }; 12}
Read more about the parameters and functionality for building custom transitions.
For achieving the best experience it's vital to get rid of JS evaluation during animation run. React-native Animated API allows for scaling in both axis using native drivers, but it's not possible to resize width and height (which calls for a layout computation). Thus the native driver is used only when the ratio of source and target component are the same and it's recommended for the best quality of animations.
Some of the concepts in the library builds on ideas from @lintonye's pull request and suggestion found here: Shared element transition #941.
Christian Falch (@chrfalch), Yuuki Arisawa (@uk-ar), Joe Goodall (@joegoodall1), sonaye, David Chavez, muhaimincs, KingTayTay, pedrobullo, Nathan James, Filip Engberg, DadImScared, fabriziogiordano, kelset, rewieer, Dan Alloway, Alexander Zizzo, Monica He, Avi Patel, Julian Hundeloh, Luong Dang Hai, Peter Henderson
In order to publish new version, cd
into the lib
directory and type yarn publish
there.
Fram X - a cross platform app company from Norway.
No vulnerabilities found.
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/27 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
82 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More