Skip to content
This repository was archived by the owner on Apr 14, 2020. It is now read-only.

itsdouges/element-motion

 
 

Repository files navigation

formerly yubaba, element motion for React.js 💨✨

npm npm bundle size (minified + gzip)

Moving from a persisted element Moving to another distinct element Moving using a focal target

Why element motion?

It's all about ✨motion over state transitions ✨ - it can help with:

Talks

Element Motion @ React Sydney 3rd June 2019 Slides
React Sydney - 3rd June 2019

Installation

npm install @element-motion/core react react-dom emotion --save

or

yarn add @element-motion/core react react-dom emotion

React should be greater or equal to v16.4, emotion should be greater or equal to v9.

Tip - Both es and commonjs modules are provided in the package. Make sure to consume the es modules in production for their tree shaking ability!

Usage

import Motion, { Move } from '@element-motion/core';

({ isLarge }) => (
  <Motion triggerSelfKey={isLarge}>
    <Move>{motion => <div {...motion} className={isLarge ? 'large' : 'small'} />}</Move>
  </Motion>
);

Next steps

About

Tween between view states with declarative zero configuration element motions for React

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors