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:

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 for their tree shaking ability!

Usage

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

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

Next steps

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors