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

react-grab-visbug-copy

v1.0.4

Published

Track visual edits made with VisBug and copy them with file paths for AI agents

Readme

React Grab VisBug Copy

Track visual edits made with VisBug and copy them with file paths to give to AI agents.

React Grab VisBug Copy

What is this?

This tool combines VisBug's visual editing capabilities with React Grab's selection system to help you:

  1. 🎨 Visually edit any element on a page (colors, fonts, spacing, etc.)
  2. 📍 Track the changes you made
  3. 📋 Copy the changes as CSS + HTML to give to AI agents

Installation

NPM Package

npm install react-grab-visbug-copy
# or
pnpm add react-grab-visbug-copy

Download Locally

# Clone or download this repository
git clone https://github.com/jacksonkasi1/react-grab-visbug-copy.git

Framework Integration

Next.js (App Router)

Add this to your app/layout.tsx:

import { Script } from "next/script";

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <head>
        {process.env.NODE_ENV === "development" && (
          <>
            <Script
              src="https://unpkg.com/react-grab/dist/index.global.js"
              strategy="beforeInteractive"
            />
            <Script
              src="https://unpkg.com/react-grab-visbug-copy/dist/client/standalone.js"
              strategy="lazyOnload"
            />
          </>
        )}
      </head>
      <body>{children}</body>
    </html>
  );
}

Next.js (Pages Router)

Add this to your pages/_document.tsx:

import { Html, Head, Main, NextScript } from "next/document";
import Script from "next/script";

export default function Document() {
  return (
    <Html lang="en">
      <Head>
        {process.env.NODE_ENV === "development" && (
          <>
            <Script
              src="https://unpkg.com/react-grab/dist/index.global.js"
              strategy="beforeInteractive"
            />
            <Script
              src="https://unpkg.com/react-grab-visbug-copy/dist/client/standalone.js"
              strategy="lazyOnload"
            />
          </>
        )}
      </Head>
      <body>
        <Main />
        <NextScript />
      </body>
    </Html>
  );
}

Vite

Add this to your index.html in the <head>:

<script type="module">
  if (import.meta.env.DEV) {
    import("react-grab");
    import("react-grab-visbug-copy");
  }
</script>

Or import in your main entry file:

// src/main.tsx or src/main.jsx
if (process.env.NODE_ENV === "development") {
  import("react-grab");
  import("react-grab-visbug-copy");
}

import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";

const root = ReactDOM.createRoot(document.getElementById("root")!);
root.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>
);

Webpack

Add to your webpack config or HTML template:

<script src="https://unpkg.com/react-grab/dist/index.global.js"></script>
<script src="https://unpkg.com/react-grab-visbug-copy/dist/client/standalone.js"></script>

Or use dynamic import in your entry file:

if (process.env.NODE_ENV === "development") {
  import("react-grab");
  import("react-grab-visbug-copy");
}

Plain HTML

<!doctype html>
<html lang="en">
  <head>
    <script src="https://unpkg.com/react-grab/dist/index.global.js"></script>
    <script src="https://unpkg.com/react-grab-visbug-copy/dist/client/standalone.js"></script>
  </head>
  <body>
    <div id="root"></div>
  </body>
</html>

Live Examples

Try these interactive examples to see VisBug Copy in action:

| Example | Description | Demo | |---------|-------------|------| | 01-basic-button.html | Simple button with hover effects | Click the button, edit styles with VisBug | | 02-card-component.html | Card UI components | Edit cards with images and text | | 03-navigation-bar.html | Navbar and hero section | Edit navigation and CTA buttons | | 04-form-elements.html | Form inputs and buttons | Edit form styling and focus states |

Running Examples Locally

# Clone the repository
git clone https://github.com/jacksonkasi1/react-grab-visbug-copy.git

# Open any example in your browser
open examples/web/01-basic-button.html
# or
cd examples/web && python3 -m http.server 8080
# Then visit http://localhost:8080/01-basic-button.html

How It Works

  1. Activate: Press Cmd+C (Mac) or Ctrl+C (Windows) to activate React Grab overlay
  2. Select: Click on any element to select it
  3. Track: Press T to track the element's original styles
  4. Edit: Use VisBug tools to make visual changes
  5. Copy: Press C to copy the changes

Output Format

When you copy changes, you'll get output like:

Visual Changes

File Location

Track which file contains this component

Changes (2 style changes)

• background-color: rgb(102, 126, 234) → rgb(214, 135, 92) • font-size: 16px → 24px

Updated CSS

button.btn {
  background-color: rgb(214, 135, 92);
  font-size: 24px;
}

Updated HTML

<button class="btn" style="background-color: rgb(214, 135, 92); font-size: 24px;">Click me</button>

Tracked with React Grab VisBug Copy

Example: Giving Changes to AI

Copy the output and paste to your AI:

I changed the button background color to rgb(214, 135, 92) and increased the font size to 24px. Please apply these changes to the actual codebase.

Here are the changes:

[PASTE THE OUTPUT FROM VISBUG COPY]

Keyboard Shortcuts

| Shortcut | Action | |----------|--------| | Cmd/Ctrl + C | Activate React Grab | | T | Track selected element | | C | Copy visual changes | | X | Clear tracked changes |

API

Global API

// Get the global API
const api = window.__REACT_GRAB_VISBUG_COPY__;

// Track an element manually
api.track(element);

// Get all tracked elements
const elements = api.getTrackedElements();

// Clear all tracked changes
api.clear();

Project Structure

react-grab-visbug-copy/
├── src/
│   └── client/
│       └── standalone.ts    # Main source code
├── dist/
│   └── client/
│       ├── standalone.js    # ES module build
│       └── standalone.cjs   # CommonJS build
├── examples/
│   └── web/
│       └── with-visbug-extension.html  # Demo page
├── package.json
└── README.md

Requirements

  • Chrome browser with VisBug extension installed
  • React Grab library
  • Modern browser with Clipboard API support

Use Cases

💻 Code Reviews

Include visual change diffs in PR descriptions to show what was modified.

🤖 AI-Assisted Development

Describe visual changes to AI and let it apply them to your codebase.

📝 Documentation

Track visual changes during design iteration and document them.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE for details.

Credits

  • VisBug - Open source web design debug tools
  • React Grab - Select context for coding agents

Star this repo if it helps you!