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

@luvikung/three-next

v1.3.2

Published

A lightweight React/Next.js integration layer for Three.js. Manages the WebGL renderer lifecycle, animation loop, resize handling, WebGL context loss/restoration, and error boundaries.

Downloads

328

Readme

three-next

npm version npm downloads npm license

A lightweight React/Next.js integration layer for Three.js. It manages the WebGL renderer lifecycle, animation loop, resize handling, WebGL context loss/restoration, and error boundaries — so you only need to implement your scene logic.

react and three are peer dependencies.

Why "three-next" not "R3F"?

  • Fully customizable — build Three.js instances natively, with full TypeScript support via @types/three.
  • Fully custom shader initialization — you own instance creation, so advanced shader pipelines (e.g. Subsurface Scattering with Screen Space Shadows) that need custom setup before the Three.js instance exists are straightforward to wire up.
  • No forced FPS cap — R3F caps your framerate for performance reasons; here the animation loop is uncapped by default, with an optional frameRate prop if you want to cap it yourself, live, in real time.
  • Lightweight — it doesn't rely on a React reconciler; your scene is plain Three.js, not React components.
  • Debuggable — works naturally with tools like stats.js.
  • Error handling built in — WebGL context loss is caught for you as a typed WebGLContextLostError, your instance gets an onError callback, and the provider swaps to your error UI and disposes cleanly — no need to hand-roll context-loss recovery.

Install

npm install @luvikung/three-next@latest

Getting started

Implement a ThreeInstance factory with your scene setup, then wrap it in <ThreeProvider> and render <ThreeCanvas>.

'use client';

import * as THREE from 'three';
import { ThreeProvider, ThreeCanvas, type ThreeInstance } from '@luvikung/three-next';

function createInstance(): ThreeInstance {
  const scene = new THREE.Scene();
  const camera = new THREE.PerspectiveCamera(75, 1, 0.1, 1000);
  camera.position.z = 5;

  const cube = new THREE.Mesh(
    new THREE.BoxGeometry(),
    new THREE.MeshStandardMaterial({ color: 0x0077ff })
  );
  scene.add(cube, new THREE.AmbientLight(0xffffff, 1));

  return {
    update: delta => {
      cube.rotation.x += delta;
      cube.rotation.y += delta;
    },
    render: renderer => renderer.render(scene, camera),
    onResize: canvas => {
      camera.aspect = canvas.clientWidth / canvas.clientHeight;
      camera.updateProjectionMatrix();
    },
    dispose: () => {
      cube.geometry.dispose();
      (cube.material as THREE.Material).dispose();
    },
  };
}

export default function Page() {
  return (
    <ThreeProvider onCreate={createInstance}>
      <ThreeCanvas className='h-screen w-screen' />
    </ThreeProvider>
  );
}

That's it — the provider owns the renderer, the animation loop, resizing, and context-loss recovery. Your instance just decides what to draw.

Learn more

License

MIT — see LICENSE.md.