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

react-three-game

v0.0.83

Published

high performance 3D game engine built in React

Readme

react-three-game

Scene Editor

JSON-first 3D game engine for React Three Fiber.

Built on top of three.js, @react-three/fiber, and @react-three/rapier.

  • 🧱 Prefabs - Save scenes as serializable JSON and load them on their own or inside other scenes.
  • 🎬 Scene Editor - Edit prefabs visually with hierarchy, inspector, transform gizmos, and play mode.
  • ⚛️ Physics - Author rigid bodies directly in prefab data and run them through Rapier.
  • 🧩 Components - Build scenes from reusable GameObject + component composition.
  • 🔧 Runtime Scene API - Mutate the live world through Scene, Entity, and EntityComponent handles.
  • ⚡ R3F Native - Use normal React Three Fiber components whenever runtime behavior is clearer in code.

Documentation

  • Website: https://prnth.com/react-three-game
  • Editor: https://prnth.com/react-three-game/editor

Install

npm install react-three-game @react-three/drei @react-three/fiber @react-three/rapier three

Usage

Here is a minimal example that renders a prefab inside a normal R3F app:

import { Physics } from "@react-three/rapier";
import { GameCanvas, PrefabRoot, ground } from "react-three-game";

const prefab = {
  id: "starter-scene",
  name: "Starter Scene",
  root: {
    id: "root",
    children: [
      ground({ size: 50, color: "#3a3" }),
      {
        id: "ball",
        components: {
          transform: {
            type: "Transform",
            properties: {
              position: [0, 5, 0],
              rotation: [0, 0, 0],
              scale: [1, 1, 1],
            },
          },
          geometry: {
            type: "Geometry",
            properties: { geometryType: "sphere", args: [0.5, 32, 32] },
          },
          material: {
            type: "Material",
            properties: { color: "#f66" },
          },
          physics: {
            type: "Physics",
            properties: { type: "dynamic" },
          },
        },
      },
    ],
  },
};

export default function App() {
  return (
    <GameCanvas>
      <Physics>
        <ambientLight intensity={0.8} />
        <PrefabRoot data={prefab} />
      </Physics>
    </GameCanvas>
  );
}

This example renders a falling sphere above a ground plane.

Prefab Editor

In addition to the runtime renderer, there is a visual editor for authoring prefabs.

import { PrefabEditor } from "react-three-game";

export default function App() {
  return <PrefabEditor initialPrefab={prefab} onChange={console.log} />;
}

Open the hosted editor here:

  • https://prnth.com/react-three-game/editor

Prefabs And Scenes

Prefab is the serializable pure data format.

Scene is the live runtime/editor world handle.

That means a saved scene is just a prefab, and the same prefab can be:

  • edited directly in PrefabEditor
  • rendered directly with PrefabRoot
  • loaded inside another scene as reusable content

Prefab Format

interface Prefab {
  id?: string;
  name?: string;
  root: GameObject;
}

interface GameObject {
  id: string;
  name?: string;
  disabled?: boolean;
  locked?: boolean;
  components?: Record<string, { type: string; properties: any }>;
  children?: GameObject[];
}

Runtime Mutation

When you need to change the live world, use the Scene API from PrefabEditorRef.

import { useEffect, useRef } from "react";
import { PrefabEditor, type PrefabEditorRef } from "react-three-game";

function RaiseBall() {
  const editorRef = useRef<PrefabEditorRef>(null);

  useEffect(() => {
    const transform = editorRef.current
      ?.scene
      .find("ball")
      ?.getComponent<{ position: [number, number, number] }>("Transform");

    transform?.set("position", [0, 8, 0]);
  }, []);

  return <PrefabEditor ref={editorRef} initialPrefab={prefab} />;
}

Useful Exports

  • GameCanvas
  • PrefabRoot
  • PrefabEditor
  • Prefab
  • GameObject
  • Scene
  • Entity
  • EntityComponent
  • registerComponent
  • ground(...)
  • loadJson() / saveJson()
  • loadModel() / loadTexture()
  • exportGLB() / exportGLBData()

Development

npm run dev
npm run build
npm run release

License

VPL