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

Declarative element motions for React

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:

Which all boil down to two areas:

  • Orchestration (collecting DOM data, enabling motion between disconnected React elements, executing motions)
  • Motions (animation concerns, CSS transitions/animations, JS animations, whatever you can imagine)

Talks

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

Installation

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

or

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

React should be at least v16.4.

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