npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

animated-styled-components

v0.6.0

Published

React Animated Styled Components

Readme

Animated Styled Components

Animated Styled Components Logotype

React Animated Styled Components is a library that aims to make ease to use plug and play animated components.

Installing Animated Styled Components

npm i animated-styled-components

Using the Animated Component

To make use of the Animated component all you need is to include the library into your project and create a new component just like you would do with any other react component.

import React, { Component } from 'react';
// Make the import into your react component file
import Animated, { FadeAnimations, RotateAnimations } from 'animated-styled-components';

class Showcase extends Component {
  render() {
    return (
      <div>
        <Animated
          animation={{
            delay_in: 5,
            in: FadeAnimations.FadeInBottom,
            duration_in: 1,
            continuous: RotateAnimations.RotateCenter,
            duration_continuous: 1,
            out: FadeAnimations.FadeOutTop,
            duration_out: 1,
            delay_between: 5
          }}
          transitions={[
            {
              type: 'hover',
              from: { property: 'border-radius', value: 0 },
              to: { property: 'border-radius', value: 10 }
            }
          ]}
        >
          This is an animated component
        </Animated>
      </div>
    );
  }
}

At the above example you can see a basic structure of an Animated Component. We will dig more into all the props later on this documentation.

Props

The Animated Component doesn't need to be filled with any props, if you don't provide props, it will just simply do nothing, but, to make the magic happen, those props are the following: animation and transitions.

Animation Prop

The animation prop is an object that needs to have the following structure:

animation={{
  delay_in: 5,
  in: FadeAnimations.FadeInBottom,
  duration_in: 1,
  continuous: RotateAnimations.RotateCenter,
  duration_continuous: 1,
  out: FadeAnimations.FadeOutTop,
  duration_out: 1,
  delay_between: 5,
  iteration: 
}}

Deconstructing the animation prop

  • in: This property receives an animation keyframe that will be used to animate in the component.
  • delay_in: This property receives and integer and will set the time that the component will take to start being animated. While this time isn't reached, the component will be mounted but will display nothing. If this property is not setted there won't be any delay in for the component to start animating.
  • duration_in: This property receives and integer greater than 0 and will set the duration in seconds for the in animation.
  • continuous: This property receives an animation keyframe that will be used to animate between in and out (if proceed).
  • duration_continuous: This property receives an integer greater than 0 and will set the duration in seconds for the continuous animation.
  • out: This property receives an animation keyframe that will be used to animate out the component.
  • duration_out: This property receives and integer greater than 0 and will set the duration in seconds for the out animation.
  • delay_between: This property receives and integer geater or equals to 0 and will set the time that will wait between the in and out animations.
  • iteration: This property receives and integer greater than 0 or the literal 'infinite' and will set the amount of iterations the animation should be doing until it goes out (if it should).

Transitions Prop

The transitions prop is an array of objects with the desired transitions that should be handled and needs to have the following structure:

transitions={[
  {
    type: 'hover',
    from: { property: 'border-radius', value: 0 },
    to: { property: 'border-radius', value: 10 }
  }
]}

Deconstructing the transitions prop

An array of objects that must contain the following structure:

  • type: This property must be a string literal from the following literals available: hover, focus, blur, active. This property is the one who's going to set the type of transition we want to achieve.
  • from: This property will define the starting values of the properties to transition. This property must be an object with the following inner properties:
    • property: This property must be a valid CSS property (it will be checked to avoid using unknown properties).
    • value: This property must be a string or a number depending on the property type (will be automatically checked to prevent inconsistencies).
  • to: This property will define the ending values of the properties to transition. This property must be an object with the following inner properties:
    • property: This property must be a valid CSS property (it will be checked to avoid using unknown properties).
    • value: This property must be a string or a number depending on the property type (will be automatically checked to prevent inconsistencies).

Animations

This component gives you a lot of built-in animations that are well tested and ready to be used.

If you want to use our built-in animations you only need to to the following when importing animated-styled-components:

{ AnimationsType } from 'animated-styled-components';

Where AnimationsType are one of the following avaible grouped animations. Each of this groups have the animations.

BounceAnimations

With the following implemented animations:

BounceInTop

BounceOutTop

BounceInRight

BounceOutRight

BounceInBottom

BounceOutBottom

BounceInLeft

BounceOutLeft

BounceInForwards

BounceOutForwards

BounceInBackwards

BounceOutBackwards


ScaleAnimations

With the following implemented animations:

ScaleInCenter

ScaleOutCenter

ScaleInBottomLeft

ScaleOutBottomLeft

ScaleInVerticalCenter

ScaleOutVerticalCenter

ScaleInTop

ScaleOutTop

ScaleInLeft

ScaleOutLeft

ScaleInVerticalTop

ScaleOutVerticalTop

ScaleInTopRight

ScaleOutTopRight

ScaleInTopLeft

ScaleOutTopLeft

ScaleInVerticalBottom

ScaleOutVerticalBottom

ScaleInRight

ScaleOutRight

ScaleInHorizontalCenter

ScaleOutHorizontalCenter

ScaleInBottomRight

ScaleOutBottomRight

ScaleInHorizontalLeft

ScaleOutHorizontalLeft

ScaleInBottom

ScaleOutBottom

ScaleInHorizontalRight

ScaleOutHorizontalRight


FadeAnimations

With the following implemented animations:

FadeIn

FadeOut

FadeInTop

FadeOutTop

FadeInBottom

FadeOutBottom

FadeInLeft

FadeOutLeft

FadeInRight

FadeOutRight

FadeInForwards

FadeOutForwards

FadeInBackwards

FadeOutBackwards

FadeInBottomLeft

FadeOutBottomLeft

FadeInBottomRight

FadeOutBottomRight

FadeInTopLeft

FadeOutTopLeft

FadeInTopRight

FadeOutTopRight


RotateAnimations

With the following implemented animations:

RotateInCenter

RotateOutCenter

RotateInBottomLeft

RotateOutBottomLeft

RotateInTop

RotateOutTop

RotateInLeft

RotateOutLeft

RotateInTopRight

RotateOutTopRight

RotateInTopLeft

RotateOutTopLeft

RotateInRight

RotateOutRight

RotateInHorizontal

RotateOutHorizontal

RotateInBottomRight

RotateInVertical

RotateOutVertical

RotateInBottom

RotateOutBottom

RotateInDiagonal

RotateOutDiagonal

RotateInDiagonalReverse

RotateOutDiagonalReverse

RotateIn45Right

RotateOut45Right

RotateIn45Left

RotateOut45Left

RotateInForwards

RotateOutForwards

RotateInBackwards

RotateOutBackwards


SlideAnimations

With the following implemented animations:

SlideInTop

SlideOutTop

SlideInLeft

SlideOutLeft

SlideInTopRight

SlideOutTopRight

SlideInTopleft

SlideOutTopLeft

SlideInRight

SlideOutRight

SlideInBottomRight

SlideOutBottomRight

SlideInBottom

SlideOutBottom

SlideInBottomLeft

SlideOutBottomLeft