playful

0.0.4 • Public • Published

▶️ Playful

A simple transition library for React (and routers!)

Table of Contents

Installation

npm install --save playful

Usage

import {withTransition} from 'playful'
 
// Create your components as you normally would
const MyComponent = () => <div>My Content</div>
 
// Define the effect you'd like your component to animate with when it is
// mounted and unmounted. Technically, you don't need to do this.
// The library has some nice smart defaults.
const playOptions = {
  effect: 'fadeAndPop',
  duration: 600,
  direction: 'up',
}
 
// Create the enhanced component using withTransition along with your
// options and component.
const PlayfulComponent = withTransition(playOptions)(MyComponent)
 
// Render it out! ✨
const App = () => {
  return (
    <div className="App">
      <PlayfulComponent />
    </div>
  )
}

Package Sidebar

Install

npm i playful

Weekly Downloads

1

Version

0.0.4

License

MIT

Unpacked Size

3.8 kB

Total Files

3

Last publish

Collaborators

  • itsjonq