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 🙏

© 2024 – Pkg Stats / Ryan Hefner

emotionaljs

v0.0.1

Published

Emotion Animation Library or Emotional is a multi-faceted animation library for React using Emotion. Comes with hooks to quickly access existing presets or scaffold new complex animations for use with CSS-in-JS object styles. Also comes with React compone

Downloads

3

Readme

Emotional

Emotion Animation Library is an animation library that allows the creation of complex animations with React that use dynamically changing props using Emotion.

API

There are two main APIs

  1. Animate: Class. Use one or more of the existing animation presets.
  2. useAnimate(): React Hook. Create a custom animation using the existing presets or scaffold a completely new animation. This is powerful as this can be used to create a Wrapper component

Class: Animate

  • name <string | string[]> One or more presets

To use one of the presets, simply use:

import { Animate } from 'emotionaljs';

const { animation } = new Animation('fadeIn');

const StyledTooltip = styled(Button)({ theme }) => ({
    display: 'relative',

    '& > .Button:hover': {
        animation
    }
})

To use multiple presets, chain them as follows:

import { Animate } from 'emotionaljs';

const { animation } = new Animation('fadeIn', 'fadeOut');

const StyledTooltip = styled(Button)({ theme }) => ({
    display: 'relative',

    '& > .Button:hover': {
        animation
    }
})

Hook: useAnimate

import { useAnimate } from 'emotionaljs';

const animation =  useAnimate({
    enter: 'fadeIn',
    enterFrom: undefined,
    enterTo: undefined,
    enterDuration: 0.2, // in seconds
    enterTimingFunction: 'ease-in-out',
    enterDelay: 0, // in seconds
    enterFillMode: 'forwards',
    enterDirection: 'reverse',
    enterIterationCount: 1,
    exit: 'fadeOut',
    exitFrom: undefined,
    exitTo: undefined,
    exitDuration: 0.2, // in seconds
    exitTimingFunction: 'cubic-bezier(0.25, 0.1, 0.25, 1)'
    exitDelay: 0, // in seconds
    exitFillMode: 'forwards',
    exitDirection: 'reverse',
    exitIterationCount: 1,
 })

Design Patterns

  • Using with CSS-in-JS
  • Chaining animations with pre-built presets
  • Complex custom animations
  • Using as a Wrapper Component