New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-slik

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-slik

React higher order component for Slik animations

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

React Slik CircleCI

React higher order component for Slik animations

About

A library that wraps your React components, providing them with animation values as props when they update.

Installation

Use npm to install react-slik.

npm install react-slik --save --save-exact

I'd recommend pinning to a specific version and using --save-exact and --save to add this to your package.json automatically.

Getting started

  • Require react-slik in the file where you'll be animating.

    import Slik from 'slik';
    import { animate } from 'react-slik';
    
  • Create your animations.

    const animation = new Slik.Animation({from: 0, to: 1});
    
  • Create a component.

    class Component extends React.Component {
      render () {
        const { scale } = this.props;
    
        return (
          <div style={{transform: `scale(${scale}, ${scale})`}}>
            Hello, World!
          </div>
        );
      }
    }
    
  • Animate your component.

    const options = {
      bind: 'update', // Default, update on all events
      startOnMount: true, // Default
      stopOnUnmount: true // Default
    };
    
    const AnimatedComponent = animate(Component, {scale: animation}, options);
    
  • Render your component.

    <AnimatedComponent />
    

Keywords

animation

FAQs

Package last updated on 25 Jun 2017

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