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

react-genie

v0.2.2

Published

### πŸ™‹β€β™‚οΈ Made by [@thekitze](https://twitter.com/thekitze)

Downloads

636

Readme

πŸ§žβ€β™‚οΈ react-genie

πŸ™‹β€β™‚οΈ Made by @thekitze

Other projects:

  • πŸ’» Sizzy - A browser for developers and designers
  • 🏫 React Academy - Interactive React and GraphQL workshops
  • πŸ’Œ Twizzy - A standalone app for Twitter DM
  • πŸ€– JSUI - A powerful UI toolkit for managing JavaScript apps

Used on sizzy.co

animation

CodeSandbox

https://codesandbox.io/s/react-genie-example-8xfsc

Demo

https://8xfsc.csb.app/

Dependencies

  • styled-components
  • layout-styled-components
  • react-animations
  • react-intersection-observer

Usage

yarn add react-genie

Just render the RevealGlobalStyles component anywhere, so it will add the class names for the animations:

import {RevealGlobalStyles} from 'react-genie'

const App = () => {
  return (
    <div>
      <RevealGlobalStyles />
      <div> rest of the app </div>
    </div>
  );
};

Default animation:

import {Reveal} from 'react-genie';

<Reveal>
  <h1>The default animation is fade in</h1>
</Reveal>

Props:

{
  animation?: string; // animation class name
  delay?: number; // animation delay
  mode?: RevealMode; // "clone" or "wrap"
  debugName?: string; // if you specify it, you will get console logs
  style?: CSSObject; // extra styles
  onShowDone?: () => void; // callback after show
}

Specifying animation using the animation prop:

import {Reveal, Animation} from 'react-genie';

<Reveal animation={Animation.SlideInLeft}>
  <h1>This title will slide in from the left</h1>
</Reveal>

Hint: you can also pass your own class name here if you have custom animations.

Wrap vs Clone

The default mode is wrap, so the children element will be wrapped in an additional div. If you don't want that additional div, you can use clone or RevealMode.Clone.

import {Reveal, RevealMode} from 'react-genie';

<Reveal mode={RevealMode.Clone}>
  <h1>This h1 will be cloned instead of wrapped</h1>
</Reveal>

In order for clone to work your element needs to accept className, style, and ref, as props. So, if you're trying to clone custom components, make sure they support these props.

The AnimatedTitle component

import {Reveal, AnimatedTitle} from 'react-genie';

<AnimatedTitle>
  This sentence will animate in word by word
</AnimatedTitle>

The AnimatedTitle component will split the children prop word by word (so it should be a string), and animate each word with a delay in between.