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

pixi-scroll-mask

v0.1.0

Published

A custom PixiJS window component based on @pixi/ui.

Downloads

3

Readme

pixi-scroll-mask

v0.1.0

pixi-scroll-mask is a small library for creating an internally scrollable window based on Pixi/UI's ScrollBox class. By internally scrollable, we mean that any part of the objects inside the ScrollMask that scroll outside the window are hidden. Please see /example for further clarification.

Install

npm install pixi-scroll-mask

Peer Dependecies

This library requires the following to be installed in your project:

npm install pixi.js @pixi/ui

Compatible versions:

  • pixi.js: ^8.0.0
  • @pixi/ui: ^2.0.0

Usage

(async () => {
  // create a canvas for the application
  const canvas = document.createElement("canvas");
  // create the application
  const app = new Application();
  // initialize the application
  await app.init({
    canvas: canvas,
    resizeTo: window,
    backgroundColor: "#000000",
  });

  // append the canvas to the document body
  document.body.appendChild(app.canvas);

  // creat a window and set its x and y coordinates to the middle of the screen
  const win = new ScrollMask({
    width: 100,
    height: 100,
    globalScroll: true,
  });
  win.x = app.renderer.width / 2 - 50;
  win.y = app.renderer.height / 2 - 50;

  // add the window to the stage
  app.stage.addChild(win);

  // define the x and y scroll positions relative to the top-left
  // of the scrolling container
  let x = 0;
  let y = 0;

  // add a wheel event listener
  document.addEventListener("wheel", (event: WheelEvent) => {
    // if the shift key is pressed scroll left <-> right
    if (event.shiftKey) {
      x += event.deltaY / 100;
      // otherwise scroll up <-> down
    } else {
      y += event.deltaY / 100;
    }
    win.scrollToPosition({ x, y });
  });

  // create an object to view through the window
  const square = new Graphics().rect(25, 25, 50, 50).fill({ color: "red" });

  // create a border for thewindow so we know where the window is
  const windowBorder = new Graphics()
    .rect(win.x, win.y, 100, 100)
    .stroke({ color: "green" });

  // add the object to the window and the border to the stage
  app.stage.addChild(windowBorder);
  win.addScrollableChild(square);
})();

License

This project is licensed under the MIT License. Please see LICENSE for details.

This project includes code adapted from Pixi/UI, licensed under the MIT License.