Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-smooth-umd

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-smooth-umd

react animation library

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-smooth

react-smooth is a animation library work on React.

npm version build status

install

npm install --save react-smooth

Usage

ordinary animation

<Animate to="0" attributeName="opacity">
  <div />
</Animate>

steps animation

const steps = [{
  style: {
    opacity: 0,
  },
  moment: 400,
}, {
  style: {
    opacity: 1,
    transform: 'translate(0, 0)',
  },
  moment: 1000,
}, {
  style: {
    transform: 'translate(100px, 100px)',
  },
  moment: 1200,
}];

<Animate steps={steps}>
  <div />
</Animate>

children can be a function

<Animate from={{ opacity: 0 }}
  to={{ opacity: 1 }}
  easing="ease-in"
  >
  {
    ({ opacity }) => <div style={{ opacity }}></div>
  }
</Animate>

you can configure js timing function

const easing = configureBezier(0.1, 0.1, 0.5, 0.8);
const easing = configureSpring({ stiff: 170, damping: 20 });

group animation

const appear = {
  from: 0,
  to: 1,
  attributeName: 'opacity',
};

const leave = {
  steps: [{
    moment: 0,
    style: {
      transform: 'translateX(0)',
    },
  }, {
    moment: 1000,
    style: {
      transform: 'translateX(300)',
      height: 50,
    },
  }, {
    moment: 2000,
    style: {
      height: 0,
    },
  }]
}

<AnimateGroup appear={appear} leave={leave}>
  { list }
</AnimateGroup>

API

Animate

nametypedefaultdescription
fromstring or object''set the initial style of the children
tostring or object''set the final style of the children
canBeginbooleantruewhether the animation is start
beginnumber0animation delay time
durationnumber1000animation duration
stepsarray[]animation keyframes
onAnimationEndfunction() => {}called when animation finished
attributeNamestring''style property
easingstring'ease'the animation timing function, support css timing function temporary
isActivebooleantruewhether the animation is active
childrenelementsupport only child temporary

AnimateGroup

nametypedefaultdescription
appearobjectundefinedconfigure element appear animation
enterobjectundefinedconfigure element appear animation
leaveobjectundefinedconfigure element appear animation

License

MIT

Copyright (c) 2015-2016 Recharts Group

Keywords

FAQs

Package last updated on 02 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc