react-navigation-transition-slide-over
This package provides a transition preset for use with React Navigation. The transition aims to mimic the current (November - 2020) transition effect used in Twitter's android mobile app.
Usage
To use import the desired transition preset from react-navigation-transition-slide-over
and spread the contents of it into the desired react-navigation
Screen's options
prop.
; // ... <StackScreen name="Home" component=Home options= title: 'Home' ...slideOverFromRightPreset />;
You can also spread the preset into a Navigator's screenOptions
prop in order to apply the transition to all child Screens.
; // ... <StackNavigator initialRouteName="Home" screenOptions= ...slideOverFromRightPreset mode="modal"> <StackScreen name="Home" component=Home /> <StackScreen name="Profile" component=Profile /></StackNavigator>;
In addition to the various spreadable transition presets, react-navigation-transition-slide-over
also makes the interpolators and transition specs directly available incase you wish to replace one or the other.
; // ... <StackScreen name="Home" component=Home options= title: 'Home' transitionSpec: open: slideOverTransitionSpec close: slideOverTransitionSpec cardStyleInterpolator: slideOverFromRightInterpolator />;
Transitions
slideOverFromRightInterpolator
- New screen slides in from the right.