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

@passeriform/solid-fiber-interaction

v0.1.0

Published

ThreeJS declarative scene and renderer for SolidJS.

Readme

@passeriform/solid-fiber-interaction

Declarative pointer interactions using raycaster for ThreeJS in SolidJS.


Overview

@passeriform/solid-fiber-interaction provides a declarative way to handle pointer interactions (hovering and selection) in a ThreeJS scene within a SolidJS application. Using the InteractionProvider as the context and useInteraction hook as the interface, you can react to pointer events on meshes directly from your component tree without managing raycasting manually.


Installation

npm install @passeriform/solid-fiber-interaction
# or
yarn add @passeriform/solid-fiber-interaction

Usage

Basic Example

import InteractionProvider, { useInteraction } from "@passeriform/solid-fiber-interaction"
import SceneProvider, { useScene } from "@passeriform/solid-fiber-scene"
import { createEffect, onCleanup, onMount } from "solid-js"
import { BoxGeometry, Mesh, MeshBasicMaterial } from "three"

const Cube = () => {
    const { addToScene } = useScene()

    const cubeMesh = new Mesh(new BoxGeometry(1, 1, 1), new MeshBasicMaterial({ color: 0xff0000 }))

    const { interaction } = useInteraction({ root: cubeMesh })

    onMount(() => {
        addToScene(cubeMesh)
    })

    onCleanup(() => {
        cubeMesh.clear()
    })

    // React to hover state
    createEffect(() => {
        if (interaction.hovered.current === cubeMesh) {
            cubeMesh.material.color.set(0x00ff00)
        } else {
            cubeMesh.material.color.set(0xff0000)
        }
    })

    return <></>
}

const App = () => {
    return (
        <SceneProvider ambientLightColor={0xffffff} directionalLightPosition={{ x: 1, y: 2, z: 3 }}>
            <InteractionProvider>
                <Cube />
            </InteractionProvider>
        </SceneProvider>
    )
}

export default App

API

InteractionProvider

A context provider that sets up pointer interaction tracking for meshes:

  • Tracks hovered and selected meshes
  • Handles repeated hover/selection events
  • Updates document.body.style.cursor automatically
  • Supports custom root object, mesh filtering, and empty selection policy
<InteractionProvider root={rootMesh} filter={(meshes) => meshes} allowEmptySelection={false}>
    {/* Components that will respond to pointer interaction */}
</InteractionProvider>

Props:

type InteractionOverridableProps<T extends Mesh> = {
    root: Object3D | undefined // root object to interact with
    filter: (meshes: Object3D[]) => T[] // filter meshes to enable interaction
    allowEmptySelection: boolean // allow clearing selection on click
}

useInteraction()

Hook to access interaction state:

const { interaction, resetSelected } = useInteraction()
  • interaction.hovered — hovered state { current, last, repeat }
  • interaction.selected — selected state { current, last, repeat }
  • resetSelected() — reset selection to undefined

You can optionally pass overrides:

const { interaction } = useInteraction({
    root: () => myRootMesh,
    filter: () => (meshes) => meshes.filter((mesh) => mesh.name.startsWith("clickable")),
})

Interaction State

type InteractionState<T extends Mesh> = {
    current: T | undefined // mesh currently hovered or selected
    last: T | undefined // previous mesh hovered or selected
    repeat: boolean // whether the current mesh is repeated interaction
}

Notes

  • InteractionProvider must be rendered inside a SceneProvider.
  • useInteraction must be called inside an InteractionProvider.
  • Cursor updates automatically to pointer when hovering an interactive mesh.
  • Filtering and root can be dynamically updated using props or setters returned by the provider.

Contributing

Contributions are welcome! Open an issue or submit a pull request to add features, fix bugs, or improve documentation.


License

MIT License