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-code-finder/nextjs

v0.0.8

Published

Next.js plugin for react-code-finder - Inspect React components and copy source locations

Readme

@react-code-finder/nextjs

Next.js plugin for react-code-finder. Inspect React components in your browser and copy their source locations to clipboard with a single click.

Perfect for passing UI context to AI coding assistants like Claude Code, Cursor, or GitHub Copilot.

Features

  • Hover over any component to see its name and source location
  • Click to copy source location to clipboard (e.g., src/components/Button.tsx:42:10)
  • Supports React 18 & 19
  • Works with Pages Router & App Router
  • React Server Components supported (file path only, no line numbers)
  • Zero runtime overhead in production

Installation

npm install @react-code-finder/nextjs --save-dev

Usage

CommonJS (next.config.js)

const { withReactCodeFinder } = require('@react-code-finder/nextjs')

module.exports = withReactCodeFinder()({
  // your next.js config
})

ES Modules (next.config.mjs)

import { withReactCodeFinder } from '@react-code-finder/nextjs'

export default withReactCodeFinder()({
  // your next.js config
})

TypeScript (next.config.ts)

import type { NextConfig } from 'next'
import { withReactCodeFinder } from '@react-code-finder/nextjs'

const nextConfig: NextConfig = {
  // your next.js config
}

export default withReactCodeFinder()(nextConfig)

Options

withReactCodeFinder({
  // Enable/disable the inspector (default: process.env.NODE_ENV === 'development')
  enabled: true,

  // Toggle button position (default: 'bottom-right')
  buttonPosition: 'bottom-right', // 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'

  // Maximum component stack depth to copy (default: 5)
  maxDepth: 5,

  // Skip anonymous/unknown components in stack trace (default: true)
  skipAnonymous: true,

  // Enable debug logging to console (default: false)
  debug: false,

  // Show overlay for components without source info (default: false)
  showNoSource: false,
})({
  // next.js config
})

How It Works

  1. A toggle button appears at the configured position when the dev server starts.
  2. Click the button to activate Inspector mode.
  3. Hover over components to see their names and source locations in an overlay.
  4. Click to copy the source location to your clipboard.

Programmatic API

Control the inspector from browser console or your code:

// Enable inspector
window.__REACT_CODE_FINDER__.enable()

// Disable inspector
window.__REACT_CODE_FINDER__.disable()

// Toggle inspector
window.__REACT_CODE_FINDER__.toggle()

// Check if inspector is enabled
window.__REACT_CODE_FINDER__.isEnabled

Troubleshooting

Enable debug: true to see detailed logs in the browser console:

withReactCodeFinder({
  debug: true,
})({
  // next.js config
})

This will log:

  • Fiber tree traversal details
  • Component source extraction
  • DevTools hook initialization status

Limitations

  • Turbopack not supported: Only Webpack bundler is supported. Do not use next dev --turbo.
  • React Server Components: RSC components show file path only (no line numbers). Client Components work fully.
  • Development mode only: Disabled in production builds.

Requirements

  • Next.js >= 12.0.0
  • React 18 or 19

License

MIT