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-native-simple-animators

v2.2.6

Published

A collection of simple, reusable react-native animator wrapper components

Downloads

20

Readme

react-native-simple-animators

Build Status

A simple, versatile and reusable animating component that can animate any of the animatable style props and will use the native driver where possible. It can also now handle event animations, e.g. on scroll.

NOTE: Version 2 has been released and it is a breaking change in the way that the imports are handled, e.g.

import { AnimateTranslateX } from 'react-native-simple-animators';
...
<AnimateTranslateX ...

has changed to

import Animator from 'react-native-simple-animators';
...
<Animator type='translateX' ...

Installation

yard add react-native-simple-animators

Usage

These animators are intended to animate their children in what I feel is a very simple way. Opacity and transform styles will use the nativeDriver which greatly improves performance.

Here is an example of a static animation:

...
const BannerText = (props) => {
  return (
    <Animator
      type='translateX'
      initialValue={-200} // value to animate from
      finalValue={0} // value to animate to
      shouldAnimateIn // flag to start the animation
      animateInCallback={null} // some function to trigger once the animation has ended
      shouldAnimateOut={false} // flag to reverse the animation (only if shouldAnimateIn was previously set)
      animateOutCallback={null} // some function to trigger once the animation has ended
      shouldRepeat // repeat the animation, ie. -200 => 0 and back to -200 etc.
      shouldLoop // loop the animation (must set shouldRepeat to work), ie. -200 => 0 => reset to 0 => -200 => 0 etc.
      duration={2000} // duration of the animation
      easing={Easing.ease} // easing
      delay={500} // useful with animating lists (DELAY * index)
      style={{ backgroundColor: 'red' }}
    >
      <Text>How easy was this?</Text>
    </AnimateTranslateX>
  );
}
...

and here's an example of an event animation:

...
const BannerText = ({ scrollY }) => {
  return (
    <Animator
      type='translateX'
      animatedValue={scrollY}
      interpolation={{
        inputRange: [0, 100], // range of the scroll value
        outputRange: [0, 200], // range of the translateX value
        extrapolate: 'clamp',
      }}
      style={{ backgroundColor: 'red' }}
    >
      <Text>How easy was this?</Text>
    </AnimateTranslateX>
  );
}
...

Demo

  1. Clone the repo.
git clone https://github.com/AuxStudio/react-native-simple-animators
  1. Install dependencies:
cd demo && yarn
  1. Run the demo
react-native run-ios

Development

  1. Clone the repo.
git clone https://github.com/AuxStudio/react-native-simple-animators
  1. Install dependencies:
yarn
  1. Make sure the tests are passing:
yarn test
  1. Create a PR.

Releases

  1. Login to npm
npm login
  1. Run the publish script.
yarn run publish