Skip to content
Branch: master
Go to file

Latest commit

berzniz committed 0766639 Mar 31, 2020
Merge pull request #69 from berzniz/dependabot/npm_and_yarn/demos/web…

Bump next from 4.2.3 to 9.3.3 in /demos/website


Failed to load latest commit information.


Super easy magic-move transitions for React apps.


  1. Page transitions

Overdrive Demo

  1. Image Gallery with next.js

Overdrive Demo

  1. With React Router

Overdrive Demo


$ npm install react-overdrive --save


Example with routing

Wrap any element (not just images) in a <Overdrive id=""></Overdrive> component. Add the same id to create a transition between the elements.

On page1.js:

import Overdrive from 'react-overdrive'

const pageA = (props) => (
    <h1>Page A</h1>
    <Overdrive id="bender-to-big-fry">
      <img src="bender.png" width="100" height="100"/>

On page2.js:

import Overdrive from 'react-overdrive'

const pageB = (props) => (
    <h1>Page B</h1>
    <Overdrive id="bender-to-big-fry">
      <img src="fry.png" width="300" height="300"/>

Now route between the pages.

Example without routing

On page.js:

import Overdrive from 'react-overdrive'

const page = (props) => (
    {props.loading && <Overdrive id="content"><Loader/></Overdrive>}
    {!props.loading && <Overdrive id="content"><Content/></Overdrive>}


Prop Description Default Value
id Required. A unique string to identify the component.
element Wrapping element type. 'div'
duration Animation duration (in milliseconds). 200
easing Animation easing function. ''
animationDelay Add delay of calculating the mounted component position. Setting to 1 usually helps avoiding issues with window scrolling. null
onAnimationEnd Event dispatched when the animation has finished. null

How does it work?

A transition is made when an <Overdrive id="example"/> component is unmounted and another <Overdrive id="example"/> is mounted not later than 100ms.

The transition is made by cloning the unmounted and mounted components, adding them with absolute position and CSS transformed from the source to the target position.


Thanks to the following companies for generously providing their services/products to help improve this project:

Thanks to BrowserStack for providing cross-browser testing.

Who made this?

Tal Bereznitskey. Find me on Twitter as @ketacode.

You can’t perform that action at this time.