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

@pouriahlabs/wisp-ui

v0.3.3

Published

Ambient motion that knows where your content is — the runtime behind the Wisp component registry.

Readme

@pouriahlabs/wisp-ui

The runtime behind the Wisp component registry.

You usually don't install this directly — the components pull it in:

npx shadcn@latest add https://wisp.pouriah.com/r/packet-field.json

That copies the component's source into your repo and adds @pouriahlabs/wisp-ui as a dependency. The component is yours to edit; this package is the small versioned part it imports.

npm i @pouriahlabs/wisp-ui

What's in it

| Hook | Does | | --- | --- | | useCanvasScene | The loop: DPR clamping, resize, in-view and hidden-tab pausing, reduced-motion still frame, teardown | | useObstacles | Measures the content boxes a scene must not draw over | | useTokenColor | Reads design tokens as HSL, and re-reads them when the theme changes | | useScriptedSequence | The same lifecycle contract for DOM-driven demo surfaces | | useFlip | First / Last / Invert / Play, for layout that moves | | useReducedMotion | One answer to "should this page hold still?" |

A minimal scene

"use client";

import * as React from "react";
import { hsl, useCanvasScene, useObstacles, useTokenColor } from "@pouriahlabs/wisp-ui";

export function Motes() {
  const ref = React.useRef<HTMLCanvasElement>(null);
  const boxes = useObstacles(ref);
  const wisp = useTokenColor("--wisp", [162, 72, 52]);

  const motes = React.useRef<{ x: number; y: number; vy: number }[]>([]);

  useCanvasScene(ref, {
    setup: ({ width, height }) => {
      motes.current = Array.from({ length: 40 }, () => ({
        x: Math.random() * width,
        y: Math.random() * height,
        vy: 12 + Math.random() * 30,
      }));
    },
    draw: ({ ctx, width, height, dt }) => {
      ctx.clearRect(0, 0, width, height);
      for (const m of motes.current) {
        m.y -= m.vy * dt;
        if (m.y < 0) m.y = height;
        // The point of the library: skip anything behind real content.
        if (boxes.current.some((b) => m.x > b.l && m.x < b.r && m.y > b.t && m.y < b.b)) continue;
        ctx.fillStyle = hsl(wisp, wisp[2] + 20, 0.7);
        ctx.fillRect(m.x, m.y, 2, 2);
      }
    },
  });

  return <canvas ref={ref} aria-hidden className="pointer-events-none absolute inset-0 h-full w-full" />;
}

Then tag the content it should avoid:

<h1 data-wisp-avoid>…</h1>
<p data-wisp-avoid>…</p>

Tag elements individually rather than one wrapper — the bands between them stay open, and motion threading through those gaps is most of what makes the effect read as deliberate.

Tokens

Wisp reads bare HSL channels, the shadcn/ui convention:

:root {
  --wisp: 162 72% 52%;
  --lantern: 42 88% 62%;
  --wisp-gain: 1; /* canvas alpha multiplier; lower it in light themes */
}

The contract

Every component in the registry certifies against this, and the hooks are how it's satisfied by construction rather than by discipline:

  • Reduced motion paints one composed still frame — never a blank box
  • Pauses off-screen and in hidden tabs
  • Re-reads tokens on theme change
  • SSR-safe, no hydration mismatch, no layout shift
  • Decorative layers are aria-hidden and pointer-events-none
  • DPR clamped
  • Zero runtime dependencies beyond React

MIT © PouriahLabs