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

@firebuzz/design-mode

v0.4.4

Published

Design mode overlay and utilities for Firebuzz landing page templates

Downloads

672

Readme

@firebuzz/design-mode

Design mode overlay and utilities for Firebuzz landing page templates. Enables visual editing of React components in development mode using React Fiber's _debugSource.

Features

  • Visual Element Selection: Click to select any element in your template
  • Runtime Element Tracking: Uses React Fiber internals (no build-time modifications needed)
  • Client-side Tailwind Generation: Generates CSS for Tailwind classes at runtime
  • Theme Customization: Live preview of theme changes (colors, fonts, etc.)
  • Element Editing: Edit className, text content, images, and links

Installation

pnpm add @firebuzz/design-mode

Usage

1. Add the Vite Plugin

In your vite.config.ts:

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import { firebuzzDesignMode } from "@firebuzz/design-mode";

export default defineConfig({
  plugins: [
    react(),
    firebuzzDesignMode(),
  ],
});

2. Create Design Mode Directory

The plugin expects a Tailwind config JSON to be generated at ./src/design-mode/tailwind.config.json. The directory will be created automatically.

3. Enable Design Mode

Design mode is automatically enabled in development (NODE_ENV=development). To disable it, set:

VITE_DESIGN_MODE=false

Configuration

The plugin accepts optional configuration:

firebuzzDesignMode({
  // Path to your tailwind.config.js (default: "./tailwind.config.js")
  tailwindConfigPath: "./tailwind.config.js",

  // Output path for generated JSON (default: "./src/design-mode/tailwind.config.json")
  outputPath: "./src/design-mode/tailwind.config.json",

  // Custom overlay script path (default: uses package's overlay)
  overlayPath: "@firebuzz/design-mode/overlay",
})

How It Works

  1. Vite Plugin: Generates Tailwind config JSON at build time and injects the overlay script
  2. Overlay Script: Listens for postMessage events from parent window and enables element selection
  3. Tailwind Generator: Generates CSS for Tailwind classes at runtime as they're applied
  4. React Fiber Integration: Tracks element source locations using React's internal _debugSource property

Message Protocol

The overlay communicates with the parent window using postMessage:

Messages to Overlay (from parent)

  • ENABLE_DESIGN_MODE: Enable design mode overlay
  • DISABLE_DESIGN_MODE: Disable design mode overlay
  • FB_SELECT_ELEMENT: Programmatically select an element
  • FB_DESELECT_ELEMENT: Deselect the current element
  • FB_UPDATE_ELEMENT: Update element properties (className, textContent, etc.)
  • FB_UPDATE_THEME: Update theme CSS variables
  • FB_GET_ALL_ELEMENTS_STATE: Request current state of all elements

Messages from Overlay (to parent)

  • FB_ELEMENT_SELECTED: User selected an element (includes source location and properties)
  • FB_ALL_ELEMENTS_STATE: Response with all elements' current state

TypeScript

The package includes full TypeScript definitions:

import type {
  DesignModeMessage,
  ElementSelectedMessage,
  ElementData,
} from "@firebuzz/design-mode";

Development

This package is part of the Firebuzz monorepo and is designed to work with Vite-based React templates.

License

MIT