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

@screenplay.space/knobs

v0.1.3

Published

Declare interactive knobs from a prototype that show up as live controls in the screenplay canvas.

Readme

@screenplay.space/knobs

Declare interactive controls (sliders, switches, selects, color pickers, text inputs) from a prototype's own code. They show up in a popover on the screenplay canvas next to the artboard's "interact" button. Knob state syncs across viewers in real time.

The package is dev-only by design. In any build with NODE_ENV set to anything other than "development", useKnob quietly returns the declared default and every postMessage path is dead-code-eliminated by the bundler — no listener is attached, no declaration is published, no value is ever read or written from a parent frame. So shipping knobs in committed code is safe: even if the deployed prototype is iframed by some non-screenplay parent in production, none of the knob protocol is wired up to act on.

Install

npm install --save @screenplay.space/knobs

react >= 17 is a peer dependency.

Use

import { useKnob } from "@screenplay.space/knobs"

export function Card() {
  const padding = useKnob({
    id: "card-padding",
    type: "slider",
    label: "Padding",
    min: 0,
    max: 64,
    step: 2,
    default: 16,
  })

  const showShadow = useKnob({
    id: "card-shadow",
    type: "boolean",
    label: "Drop shadow",
    default: true,
  })

  return (
    <div
      style={{
        padding,
        boxShadow: showShadow ? "0 2px 8px #0002" : "none",
      }}
    >
      …
    </div>
  )
}

Stable ids persist values across reloads. Renaming an id resets the value to its default.

Knob types

| type | UI control | Required fields | | --------- | -------------- | ---------------------------------------------------- | | slider | Slider | min, max, default (number); step? | | number | Numeric input | default (number); min?, max?, step? | | boolean | Switch | default (boolean) | | string | Text input | default (string); placeholder? | | select | Select | default (string); options: { value, label? }[] | | color | Color picker | default (string, e.g. "#1d4ed8") |

All knobs accept an optional label (defaults to the id) and an optional validator: (v) => v that runs locally inside the prototype on every incoming value — use it to clamp or sanitize before exposing the value to your component.

Non-React API

import { registerKnob } from "@screenplay.space/knobs"

const unsubscribe = registerKnob(
  { id: "background", type: "color", default: "#ffffff" },
  (value) => {
    document.body.style.background = String(value)
  },
)

Releasing

Publishing is automated via the Publish @screenplay.space/knobs workflow in GitHub Actions (.github/workflows/publish-knobs.yml). Open the Actions tab, pick that workflow, and click Run workflow:

  • bumppatch, minor, major, prerelease, an explicit semver (0.2.0), or none to publish the version already in package.json (use none for the very first publish, since the file already says 0.1.0).
  • tag — npm dist-tag. Defaults to latest. Use next / beta for pre-releases.

The workflow runs pnpm typecheck, publishes via npm Trusted Publishing (OIDC — no NPM_TOKEN secret), drops a git tag like screenplay-knobs-v0.1.1, and opens a PR to merge the version bump into main. Merging the PR is one click. Each release also carries a sigstore provenance attestation tying it to the workflow run.

The PR-based bump works around main branch protection — the workflow never needs to push directly to a protected branch.

One-time setup before the first run:

  1. Configure Trusted Publishing on npm. Sign in to npmjs.com → org @screenplay.space → Trusted Publishers → Add Trusted Publisher with:

    • Package: @screenplay.space/knobs
    • Publisher: GitHub Actions
    • Repository owner: zschiller
    • Repository: screenplay
    • Workflow filename: publish-knobs.yml
    • Environment name: (leave blank)
  2. Allow Actions to push branches and open PRs. GitHub repo Settings → Actions → General → Workflow permissions: select Read and write permissions. The workflow only ever pushes to release/* branches + tags — never directly to main — so this is compatible with branch protection rules requiring PRs on main.

License

MIT