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

@austinserb/react-zero-ui

v1.0.21

Published

Zero re-render UI state management for React

Readme

React Zero‑UI (Beta)

Instant UI state updates. ZERO React re‑renders. <1 KB runtime.

Pre‑render your UI once, flip a data-* attribute to update — that's it.

CI


📚 Quick Links


🚀 Live Demo

| Example | Link | What it shows | Link to Code | | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | | Interactive menu with render tracker | Main Demo↗ | Compare Zero‑UI vs. React side‑by‑side while toggling a menu. | Github | | React benchmark (10 000 nested nodes) | React 10k↗ | How long the traditional React render path takes. | Github | | Zero‑UI benchmark (10 000 nested nodes) | Zero‑UI 10k↗ | Identical DOM, but powered by Zero‑UI's data-* switch. | Github |


🧐 Why Zero‑UI?

Every setState in React triggers the full VDOM → Diff → Reconciliation → Paint pipeline. For pure UI state (themes, menus, toggles) that work is wasted.

Zero‑UI introduces "PRE‑rendering":

  1. Tailwind variants for every state are generated at build‑time.
  2. The app pre‑renders once.
  3. Runtime state changes only flip a data-* attribute on <body>.

Result → 5-10× faster visual updates with ZERO additional bundle cost.

📊 Micro‑benchmarks (Apple M1)

| Nodes updated | React state | Zero‑UI | Speed‑up | | ------------- | ----------- | ------- | -------- | | 10,000 | ~50 ms | ~5 ms | 10× | | 25,000 | ~180 ms | ~15 ms | 12× | | 50,000 | ~300 ms | ~20 ms | 15× |

Re‑run these numbers yourself via the links above.


⚡️ Quick Start

Prerequisite: Tailwind CSS v4 must already be initialized in your project.

# Inside an existing *Next.js (App Router)* or *Vite* repo
npx create-zero-ui

That's it — the CLI patch‑installs the required Babel & PostCSS plugins and updates configs for you.

Manual Install

npm install @austinserb/react-zero-ui

Then follow Setup → for your bundler.


🔧 Setup

Vite

// vite.config.*
import { zeroUIPlugin } from '@austinserb/react-zero-ui/vite';

export default {
	// ❗️Remove the default `tailwindcss()` plugin — Zero‑UI extends it internally
	plugins: [zeroUIPlugin()],
};

Next.js (App Router)

  1. Spread bodyAttributes on <body> in your root layout.

    // app/layout.tsx
    import { bodyAttributes } from '@austinserb/react-zero-ui/attributes';
    // or:  import { bodyAttributes } from '../.zero-ui/attributes';
    
    export default function RootLayout({ children }) {
    	return (
    		<html lang="en">
    			<body {...bodyAttributes}>{children}</body>
    		</html>
    	);
    }
  2. Add the PostCSS plugin (must come before Tailwind).

    // postcss.config.js
    module.exports = { plugins: { '@austinserb/react-zero-ui/postcss': {}, tailwindcss: {} } };

🏄‍♂️ Usage

react zero ui usage explained


🛠 API

useUI(key, defaultValue)

const [staleValue, setValue] = useUI<'open' | 'closed'>('sidebar', 'closed');
  • key → becomes data-{key} on <body>.
  • defaultValue → optional, prevents FOUC.
  • Note: the returned staleValue does not update (useUI is write‑only).

Tailwind variants

<div className="sidebar-open:translate-x-0 sidebar-closed:-translate-x-full" />

Any data-{key}="{value}" pair becomes a variant: {key}-{value}:.


🧬 How it works

  1. useUI → writes to data-* attributes on <body>.
  2. Babel plugin → scans code, finds every key/value, injects them into PostCSS.
  3. PostCSS plugin → generates static Tailwind classes at build‑time.
  4. Runtime → changing state only touches the attribute — no VDOM, no reconciliation, no re‑paint.

✅ Features

  • Zero React re‑renders for UI‑only state.
  • Global setters — call from any component or util.
  • Tiny: < 1 KB gzipped runtime.
  • TypeScript‑first.
  • SSR‑friendly (Next.js & Vite SSR).
  • Framework‑agnostic CSS — generated classes work in plain HTML / Vue / Svelte as well.

🏗 Best Practices

  1. UI state only → themes, layout toggles, feature flags.
  2. Business logic stays in React → fetching, data mutation, etc.
  3. Kebab‑case keys → e.g. sidebar-open.
  4. Provide defaults to avoid Flash‑Of‑Unstyled‑Content.

🤝 Contributing

PRs & issues welcome! Please read the Contributing Guide.


📜 License

MIT © Austin Serb


Built with ❤️ for the React community. If Zero‑UI makes your app feel ZERO fast, please ⭐️ the repo!