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-make-it-rain

v1.1.1

Published

<div align="center"> <a href="https://npmjs.org/package/react-native-make-it-rain"> <img src="https://img.shields.io/npm/v/react-native-make-it-rain.svg?style=flat-square" alt="npm package version" /> </a> <a href="https://npmjs.org/package/

Downloads

68

Readme

React Native "Make It Rain"

v1.0.0 breaking changes

Prop names have been generalized to represent that any type of component can be passed in as the falling pieces. The itemComponent (previously moneyComponent) no longer defaults to an SVG. This allowed for removal of the dependency on react-native-svg. Refer to the Example project for how to pass in an SVG itemComponent.

Summary

This is a self-contained component that may be placed in any component. It takes up the entire parent view and is positioned absolutely, overlaying other content in the parent.

The default animation was adapted from Shopify's Arrive confetti example.

The original Make It Rain animation was adapted from Joel Arvidsson's MakeItRain example. It has been rewritten to use react-native-reanimated.

The flavor prop selects between them.

Sample Code

import React, {Component} from 'react';
import { View, Text } from 'react-native';
import MakeItRain from 'react-native-make-it-rain';

class Demo extends Component {
  render() {
    return (
      <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
        <Text>Make It Rain</Text>
        <MakeItRain
          numItems={80}
          itemDimensions={{width: 40, height: 20}}
          itemComponent={<Text>🤍</Text>}
          itemTintStrength={0.8}
        />
      </View>
    );
  }
}

Usage

npm install react-native-make-it-rain --save

Props

| Prop | Description | Type | Default | | ------------------------------ | ---------------------------------------------------- | -------- | ---------- | | numItems | How many items fall | Integer | 100 | | itemComponent | Replaces the built-in item component. Can use any React component (Icon, Image, View, SVG etc) | Component | <View/> | | itemDimensions | Size of item. If itemComponent is supplied, size should be set to match. | Object | { width: 20, height: 10 } | | itemColors | Colors of falling items. | Array | ['#00e4b2', '#09aec5', '#107ed5'] | | itemTintStrength | Opacity of color overlay on item (0 - 1.0) | Number | 1.0 | | flavor | The animation behavior ("arrive" or "rain") | String | "arrive" | | fallSpeed | How fast the item falls | Integer | 50 | | flipSpeed | Item flip speed | Integer | 3 | | horizSpeed | How fast the item moves horizontally | Integer | 50 | | continuous | Rain down continuously | Boolean | true |

Sample Application

If you'd like to see it in action, run these commands:

cd Example
npm run cp
npm install
npm start

The sample app is an Expo project created with create-react-native-app.

Development

The source files are copied from the project root directory into Example/react-native-make-it-rain using npm run cp. If a source file is modified, it must be copied over again with npm run cp.

Ideally the Example project could include the parent's source files using package.json, but that causes a babel interopRequireDefault runtime error.

Credits

Cash SVG in the Example project was sourced from IconFinder and is used under the Creative Commons license.

ToDo

  • Tests