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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@shadahmad7/react-native-confetti

v0.0.2

Published

Pure JS/TS Confetti View and Controller for React Native (no native code required)

Downloads

120

Readme

🎉 @shadahmad7/react-native-confetti

A lightweight, customizable, and performant confetti animation library for React Native (CLI) powered by Reanimated.

Perfect for celebrations, success states, rewards, onboarding, and delightful UI moments.


✨ Features

  • 🚀 Smooth animations using react-native-reanimated
  • 🎨 Fully customizable (colors, size, spread, intensity)
  • 🔁 Looping & manual trigger support
  • 🧠 Imperative API (trigger() via ref)
  • 📱 Works with React Native CLI
  • ⚡ Lightweight & easy to integrate

📦 Installation

npm install @shadahmad7/react-native-confetti

⚠️ Peer Dependencies (Required)

You MUST install these in your project:

npm install react-native-reanimated react-native-svg react-native-worklets

Supported Versions

  • react-native-reanimated4.x
  • react-native-svg15.x
  • react-native-worklets0.6.x

⚙️ Setup

1. Reanimated Setup

Follow official setup:

👉 Add this to your babel.config.js

module.exports = {
  presets: ["module:@react-native/babel-preset"],
  plugins: ["react-native-reanimated/plugin"],
};

2. iOS Setup

cd ios && pod install

3. Rebuild App (IMPORTANT)

npx react-native run-android
# or
npx react-native run-ios

🚀 Usage

import React, { useRef } from "react";
import { SafeAreaView, Button, Alert } from "react-native";
import { Confetti, ConfettiHandle } from "@shadahmad7/react-native-confetti";

export default function App() {
  const confettiRef = useRef<ConfettiHandle>(null);

  const triggerConfetti = () => {
    confettiRef.current?.trigger();
  };

  const handleComplete = () => {
    Alert.alert("Confetti completed!");
  };

  return (
    <SafeAreaView
      style={{ flex: 1, justifyContent: "center", alignItems: "center" }}
    >
      <Button title="Show Confetti" onPress={triggerConfetti} />

      <Confetti
        ref={confettiRef}
        count={50}
        colors={["#ff0000", "#00ff00", "#0000ff", "#ffff00"]}
        intensity={1.5}
        spread={25}
        minSize={4}
        maxSize={16}
        opacityRange={[40, 90]}
        autoPlay={false}
        loop={false}
        onComplete={handleComplete}
      />
    </SafeAreaView>
  );
}

🎛 Props

| Prop | Type | Default | Description | | -------------- | ------------------ | ---------------------------------------------- | --------------------------- | | count | number | 200 | Number of confetti pieces | | colors | string[] | ["#1b70de", "#32af4b", "#ff0000", "#ffff00"] | Colors array | | intensity | number | 1 | Speed & distance multiplier | | spread | number | 15 | Angle spread (degrees) | | minSize | number | 6 | Minimum size | | maxSize | number | 12 | Maximum size | | fallDuration | number | 5500 | Falling duration (ms) | | upDuration | [number, number] | [1000, 1600] | Upward duration range | | opacityRange | [number, number] | [25, 90] | Opacity range (%) | | autoPlay | boolean | true | Auto start animation | | loop | boolean | false | Repeat animation | | onComplete | () => void | — | Called after animation ends | | style | ViewStyle | — | Container styling |


🎬 Demo

Confetti Demo

🎮 Imperative API

export interface ConfettiHandle {
  trigger: () => void;
}

Example

confettiRef.current?.trigger();

⚠️ Troubleshooting

❌ Confetti not visible?

  • Ensure react-native-svg is installed
  • Add zIndex:
<Confetti style={{ zIndex: 999 }} />

❌ Animation not running?

  • Check Reanimated setup
  • Ensure Babel plugin is added
  • Rebuild app (not hot reload)

🛠 Roadmap

  • [ ] Preset animations (burst, rain, explosion)
  • [ ] Performance mode (no SVG)
  • [ ] Custom shapes API
  • [ ] Web support

🤝 Contributing

PRs welcome! Open issues for bugs or feature requests.


📄 License

MIT © Shad Ahmad


⭐ Support

If you like this package, give it a ⭐ on GitHub!