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

tweakit

v0.7.3

Published

A dependency-free, code-split real-time parameter panel — sliders, toggles, a wide-gamut OKLCH color picker, curve editors and more, from a plain schema.

Readme

Tweakit

npm

A dependency-free, code-split, real-time parameter panel. Hand it a plain schema and it builds a live control for each value: sliders, toggles, dropdowns, a wide-gamut OKLCH color picker, gradient, shadow, cubic-bézier and motion editors, a spring tuner, a four-sided length (padding, margin or radii) on one row, monitors, a 2D point pad, and more.

Docs & live examples →

Why tweakit

Tweakpane, lil-gui and Leva are all good panels: Tweakpane for its plugin ecosystem, lil-gui for the smallest footprint, Leva if your app is React hooks throughout. Tweakit is for when the values you're tuning are color and motion:

  • Wide-gamut color. An OKLCH picker that reaches past sRGB into Display P3 and Rec. 2020 and says which gamut a color is in, eleven notations, and the value handed back exactly as you wrote it until you edit it.
  • Motion editors that match Motion. Easing, cubic-bézier and spring editors; a time-mode spring (visualDuration, bounce) resolves exactly as Motion does, and every one hands back a ready transition easing, a sampled linear() for springs.
  • Markup mode. [data-twk] elements become controls in place, no script per control.
  • CSP-safe. The plot control parses its expressions itself, with no eval or new Function.
  • Values back into source. The copy button puts the tuned values on the clipboard as JSON, and AGENTS.md tells a coding agent how to apply them.

Install

npm install tweakit

tweakit is an ES module only. In a CommonJS project, set "type": "module" in package.json, or load it with await import("tweakit"); TypeScript under moduleResolution: node16 needs the same. There, a .cts file imports the types as import type { Schema } from "tweakit" with { "resolution-mode": "import" } (TS1541 without it; nodenext on current TypeScript does without it).

Use

import { tweaks } from "tweakit";
import "tweakit/css";

const panel = tweaks("Card", {
  blur: [24, 0, 100, 1],          // slider
  visible: true,                   // checkbox
  blend: ["normal", "multiply"],   // list
  tint: "#7C5CFF",                 // wide-gamut color picker
});
document.body.append(panel.el);
panel.on((values) => { /* values.blur, values.tint, … */ });

Panels can also come from [data-twk] markup, bound by enhance(). Importing tweakit binds nothing on its own; import tweakit/auto instead (the same API) to bind the page's markup once it has parsed.

In React (or Vue, Svelte, Solid)

The panel isn't a component: create it once in a mount effect, append panel.el to a ref, and destroy it on unmount. params is updated in place, so copy it into state.

import { useEffect, useRef, useState } from "react";
import { tweaks } from "tweakit";
import "tweakit/css";

function Card() {
  const host = useRef(null);
  const [p, setP] = useState({ radius: 18, tint: "#7C5CFF" });
  useEffect(() => {
    const panel = tweaks("Card", { radius: [18, 0, 60, 1], tint: "#7C5CFF" });
    host.current.append(panel.el);
    panel.on((values) => setP({ ...values }));
    return () => panel.destroy();
  }, []);
  return (<><div ref={host} /><div style={{ borderRadius: p.radius, background: p.tint }} /></>);
}

Gate it behind a development flag (import.meta.env.DEV): tweakit has no production switch of its own.

Everything else is on the docs site: every control live, the panel API, theming, markup-driven panels, and the two builds (the single-file build vs the code-split entry).

Coding agents

Read node_modules/tweakit/AGENTS.md before writing tweakit code. It is the guide for agents (every control and the value it returns, the panel API, how copied values come back), version-matched to the installed package, and also at ryankiley.github.io/tweakit/AGENTS.md. To keep it in reach, add to your project's AGENTS.md or CLAUDE.md:

This project uses tweakit. Explore the code first, then read node_modules/tweakit/AGENTS.md
before writing tweakit code; prefer it over what you remember. Values tuned in a panel arrive
as JSON from its copy button; apply them to the schema defaults in source, not to the panel.

Or hand your agent the whole job:

Install tweakit in this repo. Read https://ryankiley.github.io/tweakit/AGENTS.md first.
Install it with this project's package manager, import "tweakit/css", and add one panel with
a few controls to an existing component so I can tune it live. Bind the values to its styles.
Verify the build.

Floating panel

Every panel drags by its header and lifts into a fixed layer on the first drag. Pass floating to start it there (true sits 16px in from the top-left; { x, y } sets the insets), and draggable: false to pin it. A draggable panel with persist remembers where it was dropped. Its placement is plain .twk-panel CSS, so a class of yours overrides it; the panel API page has the recipe.

Develop

npm install
npm run build
npm test

CI runs Node 22. The build works on Node 20+, but the test suite runs under jsdom, which needs Node 22.22, 24.15 or newer.

Contributions welcome; see CONTRIBUTING.md. Report security issues per SECURITY.md.

Credits

Inspired by Tweakpane and dialkit. Toolbar and control icons from Hugeicons; see THIRD-PARTY-NOTICES.md.