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

@click-to-source-3d/overlay

v0.1.3

Published

Interactive inspection overlay for Click-to-Source 3D

Readme

@click-to-source-3d/overlay

React Three Fiber components for inspecting a running scene: click a mesh, see the source location and the arguments that produced it, edit those arguments in place.

Part of Click-to-Source 3D.

Scope

React Three Fiber only. The overlay is React, <SelectionHighlight /> and <ClickToSourceBridge /> need the R3F tree, and automatic source stamping is a JSX transform. Plain Three.js can use @click-to-source-3d/core directly with hand-written userData.sourceRef, but the experience described here is R3F.

Vite is required for the dev-server half — see @click-to-source-3d/vite-plugin.

Install

Two installs bring four packages; core and shared arrive as dependencies.

npm install @click-to-source-3d/overlay
npm install -D @click-to-source-3d/vite-plugin

Wiring

Five things go into your app.

1. The plugin, conventionally listed before react():

// vite.config.js
plugins: [clickToSource({ stampSource: true, captureInstances: true }), react()]

2. Resolve a click and put the result in the store:

const resolveClick = useClickToSource();

const handlePointerUp = (e) => {
  e.stopPropagation();
  const resolved = resolveClick(e);
  resolved
    ? useOverlayStore.getState().select(resolved)
    : useOverlayStore.getState().clearSelection();
};

3. <SelectionHighlight /> — inside the Canvas. It outlines the selection.

4. <GenerationTrace /> — outside the Canvas. It renders DOM, not scene objects, and shows the file, function, line and editable arguments.

5. <ClickToSourceBridge /> — inside the Canvas, only if you want the agent tools in @click-to-source-3d/mcp to query the live scene.

Limits worth knowing before you adopt it

Instanced provenance is read-only. An instance's transform comes from whatever placed it — usually a seeded RNG — so there is no literal in your source to rewrite. The panel shows the values and refuses to edit them.

Variant-class values cannot be recovered. Automatic capture reads a Matrix4, so it recovers x, y, z, scale and yaw and nothing else. Which colour group, species or material variant an instance belongs to is not in the transform and is gone. Capture recovers placement, not classification. If you need the classification, keep writing userData.instanceSourceRefs by hand.

Selection highlighting is mesh-wide for instanced meshes. Clicking one instance outlines every instance in that InstancedMesh. Resolution is per-instance and correct; only the outline is coarse.

<SelectionHighlight /> takes over the render loop. It draws through useFrame at priority 1, which makes R3F hand rendering to it. It will not compose with other post-processing that also claims a priority. Under frameloop="demand" it works — it requests a frame when the selection changes. Under frameloop="never" it cannot, and warns once in development.

<ClickToSourceBridge /> answers only while the page renders. R3F does not render Canvas children in a hidden or background tab, so a backgrounded page reports disconnected, indistinguishable from no page at all.

License

MIT