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

a3model

v1.0.8

Published

Accessibility for Three.js models

Downloads

25

Readme

a3: Accessibility for Three.js models

Version

a3 aims to improve the accessibility of Three.js models by offering keyboard navigation for hover and click events, focus indication on meshes/objects, mobile touch events, cursor updates, and roles/descriptions for screen readers.

Installation

npm install a3model 

Documentation

import A3 from 'a3model'
import 'a3model/src/index.css';

Wrap the canvas element with a div element, as shown below.

<div id='a3canvas'><canvas id='webgl'></canvas></div>

Initialize the A3 object with the canvas DOMElement, renderer, a3canvas DOMElement and renderer size.

const canvas = document.querySelector('canvas.webgl')
const renderer = new THREE.WebGLRenderer({canvas: canvas})
const a3canvas = document.getElementbyID('a3canvas')
const sizes = {
    'width': window.innerWidth,
    'height': window.innerHeight
}
const mya3 = new A3(canvas, renderer, a3canvas, sizes);

For every mesh or object that you want to make focusable, call createBox. It is important that you provide an unique name for each of these meshes. You can specify a role for the mesh, such as "button".

mesh.name = 'uniqueName'
mesh = mya3.createBox(mesh, role=null)

Click Events

To click on a mesh with a keyboard, tab to the mesh and press 'Enter'. Upon hover over with a mouse, the cursor will change from 'default' to 'pointer'. All click events are translated to touch events on mobile devices.

For every click event in your model, identify the mesh name, the function that will be called during the click event, and a description for the screen reader.

mya3.click(meshname, function, description)

For the function, use the functWrapper function to wrap the function and its arguments.

function = mya3.functWrapper(funct, ...args)

Hover Events

To hover on a mesh with a keyboard, press 'Tab'. Similar to the click event, specify the mesh name, function called during the hover event, and description for the screen reader.

mya3.hover(meshname, function, description)

Update Focus Boxes on Camera Change

For any change to the camera orientation, call updateBoxes to update the focus boxes.

mya3.updateBoxes(camera)

Render

If you specified any click or hover events, call renderEffects.

mya3.renderEffects(camera)

In your animation loop, call render.

mya3.render(scene, camera)

Remove Mesh

When you remove a mesh from the scene, remove the corresponding DOM element.

scene.remove(mesh)
mya3.remove(mesh)