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

@david-xpn/llm-ui-feedback

v0.1.0

Published

Drop-in React feedback widget that captures component context for LLM consumption

Readme

@david-xpn/llm-ui-feedback

Drop-in React feedback widget that captures component context for LLM consumption.

Users click on any element in your app, leave a comment, and the widget captures a rich context bundle — React component tree, props, screenshot with marker, and a pre-formatted LLM prompt — ready to paste into Claude, ChatGPT, or any LLM chat.

Features

  • One-line integration — add <FeedbackWidget /> to your root, done
  • React component tree capture — walks the fiber tree to extract component names and props
  • Screenshot with X marker — captures the viewport and marks the clicked element
  • LLM-ready prompt — generates a structured prompt with page URL, component path, props, element text, and user comment
  • Copy & download — copy the prompt to clipboard and download the screenshot
  • localStorage persistence — no backend needed, all data stays client-side
  • Feedback list panel — view, copy, and manage all saved feedback entries
  • Configurable — position, color, and keyboard shortcut

Install

npm install @david-xpn/llm-ui-feedback

Quick Start

import { FeedbackWidget } from '@david-xpn/llm-ui-feedback';

function App() {
  return (
    <>
      <YourApp />
      <FeedbackWidget />
    </>
  );
}

That's it. A floating + button appears in the bottom-right corner. Click it to enter pick mode, click any element, leave a comment, and get an LLM-ready prompt.

Props

| Prop | Type | Default | Description | | --- | --- | --- | --- | | position | 'bottom-right' \| 'bottom-left' \| 'top-right' \| 'top-left' | 'bottom-right' | Corner position for the floating button | | buttonColor | string | '#3b82f6' | Hex color for the FAB button | | hotkey | string | undefined | Keyboard shortcut to toggle pick mode (e.g. 'Alt+F') |

Example with all props

<FeedbackWidget
  position="bottom-left"
  buttonColor="#10b981"
  hotkey="Alt+F"
/>

How It Works

  1. User clicks the + floating button to enter pick mode
  2. User clicks any element on the page
  3. The widget captures:
    • Component path — React fiber tree walk (e.g. App > Layout > Dashboard > MetricCard)
    • Props — scalar props (strings, numbers, booleans) from each component
    • Element text — innerText of the clicked element (truncated to 100 chars)
    • Page URL — current window.location.href
    • Screenshot — viewport capture via html2canvas-pro with a red X at the click position
  4. User types a comment and saves
  5. The entry is stored in localStorage with a pre-formatted LLM prompt
  6. User can copy the prompt and download the screenshot to paste into any LLM

Example prompt output

Page: https://myapp.com/dashboard/metrics
Component: App > Layout > Dashboard > MetricCard
Props:
  MetricCard: {"metricId":"revenue","period":"Q4"}
Element text: "Revenue: $1.2M"

User feedback: "This number looks wrong, should be $1.4M"

Screenshot attached with red X marking the clicked element.

Exported API

// Components
import { FeedbackWidget } from '@david-xpn/llm-ui-feedback';

// Types
import type {
  FeedbackWidgetProps,
  FeedbackEntry,
  CapturedContext,
  ComponentInfo,
  WidgetPosition,
} from '@david-xpn/llm-ui-feedback';

// Storage utilities (for programmatic access)
import {
  loadEntries,
  deleteEntry,
  clearEntries,
} from '@david-xpn/llm-ui-feedback';

Storage utilities

| Function | Description | | --- | --- | | loadEntries() | Returns all saved FeedbackEntry[] from localStorage | | deleteEntry(id) | Deletes a single entry by ID | | clearEntries() | Removes all feedback entries |

Production Setup

In production builds, minifiers rename component functions (MetricCard becomes t), which makes the component path useless. Configure your bundler to preserve function names:

Vite

// vite.config.ts
export default defineConfig({
  esbuild: {
    keepNames: true,
  },
});

webpack (Terser)

// webpack.config.js
module.exports = {
  optimization: {
    minimizer: [
      new TerserPlugin({
        terserOptions: { keep_fnames: true },
      }),
    ],
  },
};

Next.js

// next.config.js
module.exports = {
  webpack: (config) => {
    const terser = config.optimization?.minimizer?.find(
      (p) => p.constructor.name === 'TerserPlugin'
    );
    if (terser) {
      terser.options.terserOptions = {
        ...terser.options.terserOptions,
        keep_fnames: true,
      };
    }
    return config;
  },
};

See docs/production-setup.md for more bundler configurations.

Requirements

  • React 18+
  • Browser environment (uses localStorage, document, html2canvas-pro)

License

MIT