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

flappybirdloader

v1.2.0

Published

A React FlappyBird game component that can be used as a loading screen or standalone game

Readme

FlappyBirdLoader

A React component that renders a playable FlappyBird game. Perfect for loading screens, easter eggs, or just adding some fun to your application!

Installation

npm install flappybirdloader

or

yarn add flappybirdloader

or

pnpm add flappybirdloader

That's it! All assets are embedded in the package - no additional setup required. 🎉

Usage

Basic Usage

import FlappyBirdLoader from "flappybirdloader";

function App() {
  return (
    <div>
      <FlappyBirdLoader />
    </div>
  );
}

With Custom Size

import FlappyBirdLoader from "flappybirdloader";

function App() {
  return (
    <div>
      <FlappyBirdLoader width={600} height={400} />
    </div>
  );
}

With Callbacks

import FlappyBirdLoader from "flappybirdloader";

function App() {
  const handleScoreChange = (score: number) => {
    console.log("Current score:", score);
  };

  const handleGameOver = (score: number, bestScore: number) => {
    console.log("Game over! Score:", score, "Best:", bestScore);
  };

  return (
    <div>
      <FlappyBirdLoader
        onScoreChange={handleScoreChange}
        onGameOver={handleGameOver}
      />
    </div>
  );
}

As a Loading Screen

import { useState, useEffect } from "react";
import FlappyBirdLoader from "flappybirdloader";

function App() {
  const [loading, setLoading] = useState(true);

  useEffect(() => {
    // Simulate loading
    setTimeout(() => setLoading(false), 5000);
  }, []);

  if (loading) {
    return (
      <div
        style={{
          display: "flex",
          justifyContent: "center",
          alignItems: "center",
          height: "100vh",
        }}
      >
        <FlappyBirdLoader />
      </div>
    );
  }

  return <div>Your app content here</div>;
}

Next.js Usage

For Next.js applications with the App Router, you'll need to mark the component as client-side:

"use client";

import FlappyBirdLoader from "flappybirdloader";

export default function GamePage() {
  return (
    <div>
      <FlappyBirdLoader />
    </div>
  );
}

Or create a client component wrapper:

// components/FlappyBirdClient.tsx
"use client";

import FlappyBirdLoader from "flappybirdloader";

export default FlappyBirdLoader;

Then use it in your pages:

// app/page.tsx
import FlappyBirdClient from "@/components/FlappyBirdClient";

export default function Home() {
  return (
    <div>
      <FlappyBirdClient />
    </div>
  );
}

Props

| Prop | Type | Default | Description | | --------------- | -------------------------------------------- | ----------- | ------------------------------------- | | width | number | 800 | Width of the game canvas in pixels | | height | number | 512 | Height of the game canvas in pixels | | onScoreChange | (score: number) => void | undefined | Callback fired when the score changes | | onGameOver | (score: number, bestScore: number) => void | undefined | Callback fired when the game ends |

Controls

  • Click on the canvas to make the bird jump
  • Spacebar to make the bird jump
  • Click "Play Again" after game over to restart

Features

  • ✨ Fully playable FlappyBird game
  • 🎮 Keyboard and mouse controls
  • 🔊 Sound effects (can be muted by browser settings)
  • 💾 Saves best score to localStorage
  • 📱 Responsive to custom sizes
  • ⚡ Zero dependencies (only React peer dependency)
  • 🎨 Pixel-perfect graphics
  • 🪝 Callback hooks for score tracking
  • 📦 All assets embedded - no external files needed!

Browser Support

Works in all modern browsers that support:

  • HTML5 Canvas
  • ES6+
  • React 16.8+ (Hooks)

Troubleshooting

Next.js specific issues

Remember to add "use client" directive at the top of your component file when using in Next.js App Router.

TypeScript errors

Make sure you have @types/react installed in your project.

License

MIT

Credits

Based on the classic FlappyBird game. All sprites and sounds are included in the package.