MCPcopy
hub / github.com/berzniz/react-overdrive

github.com/berzniz/react-overdrive @v0.1.1 sqlite

repository ↗ · DeepWiki ↗ · release v0.1.1 ↗
88 symbols 241 edges 20 files 0 documented · 0%
README

react-overdrive

Super easy magic-move transitions for React apps.

Demos

  1. Page transitions

Overdrive Demo

  1. Image Gallery with next.js

Overdrive Demo

  1. With React Router

Overdrive Demo

Install

$ npm install react-overdrive --save

Usage

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="https://github.com/berzniz/react-overdrive/raw/v0.1.1/bender.png" width="100" height="100"/>
    </Overdrive>



);

On page2.js:

import Overdrive from 'react-overdrive'

const pageB = (props) => (



    <h1>Page B</h1>
    <Overdrive id="bender-to-big-fry">
      <img src="https://github.com/berzniz/react-overdrive/raw/v0.1.1/fry.png" width="300" height="300"/>
    </Overdrive>



);

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>}



);

API

Prop Description Default Value
id Required. A unique string to identify the component.
element Wrapping element type. 'div'
duration Animation duration (in milliseconds). 200
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.

Sponsors

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.

Core symbols most depended-on inside this repo

prefix
called by 8
src/prefix.js
onHide
called by 4
src/overdrive.js
onShow
called by 4
src/overdrive.js
getPosition
called by 4
src/overdrive.js
animate
called by 2
src/overdrive.js
animateEnd
called by 2
src/overdrive.js
clearAnimations
called by 2
src/overdrive.js
render
called by 1
demos/nextgram/components/modal.js

Shape

Function 57
Method 20
Class 11

Languages

TypeScript100%

Modules by API surface

lib/Overdrive.min.js36 symbols
src/overdrive.js14 symbols
demos/nextgram/pages/index.js8 symbols
demos/website/pages/index.js6 symbols
demos/website/pages/_document.js5 symbols
demos/nextjs/pages/_document.js5 symbols
demos/react-router-v4/src/App.js4 symbols
demos/nextgram/components/modal.js4 symbols
demos/nextjs/pages/index.js3 symbols
src/prefix.js1 symbols
demos/website/pages/character.js1 symbols
demos/nextjs/pages/character.js1 symbols

Dependencies from manifests, versioned

babel6.5.2 · 1×
babel-core6.22.1 · 1×
babel-eslint7.0.0 · 1×
babel-jest19.0.0 · 1×
babel-loader6.2.10 · 1×
babel-plugin-add-module-exports0.1.2 · 1×
babel-plugin-transform-class-properties6.19.0 · 1×
babel-plugin-transform-decorators-legacy1.3.4 · 1×
babel-plugin-transform-es2015-modules-commonjs6.22.0 · 1×
babel-plugin-transform-object-rest-spread6.20.2 · 1×
babel-plugin-transform-runtime6.23.0 · 1×
babel-polyfill6.16.0 · 1×

For agents

$ claude mcp add react-overdrive \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact