rchi-v1.4.0.mp4
React Component Hover Inspector (RCHI) is a Chrome Extension that helps you identify, navigate, and open the source of React/Next.js components directly from the page.
- 🔍 Inspect any React/Next.js (RSC) component by hovering over it.
- 🏷️ Display the DOM tag, nearest meaningful React component name, and element dimensions.
- 📌 Pin an inspected component to keep the selection stable while exploring component ownership.
- ⌨️ Navigate up the React component hierarchy with Ctrl+Shift+X, skipping framework and wrapper components.
- 📋 Copy the resolved component name to the clipboard with a single click.
- 🚀 Open the exact JSX source location in VS Code IDE when code-inspector-plugin metadata is available.
- ⚛️ Supports React Fiber inspection through internal React DOM properties and Fiber tree traversal.
- 🧩 Resolves React 19 Server Components using React DevTools metadata or Fiber debug information.
- 🎭 Automatically skips intrinsic-style wrappers such as motion.div and styled.div to surface meaningful user components.
- 🎯 Visual element highlighting with real-time inspection overlays.
- 🔖 Toolbar badge indicates when the inspector is active.
- Click the extension toolbar button to enable or disable inspection for the current tab.
- While enabled, move the pointer over an element to highlight it and display the DOM tag, nearest meaningful React component name, and element dimensions.
- Click an inspected element to pin the selection. Click the pinned element again to release it and resume normal hover inspection.
- Press
Ctrl+Shift+Xto move from the nearest accepted React component to its next meaningful owner. Pinning first keeps the inspected DOM element stable while navigating through wrapper components. - Use the clipboard button in the pinned label to copy the resolved component name.
- Use the source button to open the inspected JSX node in your configured IDE
when
code-inspector-pluginmetadata is available. This launches the file at the exact JSX line and column through your operating system's configured IDE. - The inspector checks React DOM properties such as
__reactFiber$,__reactInternalInstance$, and__reactProps$, then walks up the Fiber tree. - React 19 Server Components are resolved through React DevTools metadata when
available and Fiber
_debugInfovirtual component entries otherwise. - Intrinsic-style library wrappers such as
motion.divandstyled.divare skipped so traversal continues to the nearest uppercase user component. - The toolbar badge displays
ONwhile the inspector is active.
The extension is intentionally limited to localhost and 127.0.0.1 over HTTP
or HTTPS. Chrome match patterns apply to every port, including 3000 and
3004.
Requires Node.js 18 or newer.
npm install
npm run check
npm run buildThe loadable extension is generated in dist/.
For continuous rebuilding during development:
npm run devAfter a rebuild, click Reload on the extension card in
chrome://extensions. The localhost page can remain open; the next toolbar
click injects the updated inspector automatically.
- Open
chrome://extensions. - Turn on Developer mode in the upper-right corner.
- Click Load unpacked.
- Select this project's
distdirectory. - Pin React Component Hover Inspector from Chrome's Extensions menu.
- Open or reload a supported local React page.
- Click the toolbar icon. The
ONbadge confirms that hover inspection is active.
Click the icon again to turn the inspector off.
The source button integrates with
code-inspector-plugin. The plugin
injects exact JSX file, line, and column metadata and runs a localhost server
that opens the configured IDE. No VS Code extension is required.
Install it in the React or Next.js project being inspected:
npm install --save-dev code-inspector-pluginInstalling the package alone is not enough. It must also be registered in the
project's bundler configuration so it can add data-insp-path metadata to
rendered elements.
For Next.js 15.3 or newer, including Next.js 16, with Turbopack:
// next.config.ts
import type { NextConfig } from "next";
import { codeInspectorPlugin } from "code-inspector-plugin";
const nextConfig: NextConfig = {
turbopack: {
rules: codeInspectorPlugin({
bundler: "turbopack",
hideConsole: true,
hotKeys: false,
showSwitch: false,
}),
},
};
export default nextConfig;For Next.js using Webpack:
// next.config.js
const { codeInspectorPlugin } = require("code-inspector-plugin");
module.exports = {
webpack(config) {
config.plugins.push(
codeInspectorPlugin({
bundler: "webpack",
hideConsole: true,
hotKeys: false,
showSwitch: false,
}),
);
return config;
},
};Restart the development server after changing the configuration, then reload the page. Hover over an element and pin it to use the source button beside the copy button.
The source button remains disabled when the plugin is not registered, the
development server was not restarted, or no data-insp-path metadata is
available for that element.
This first integration opens the JSX location associated with the inspected DOM
element. Navigating component owners with Ctrl+Shift+X changes the displayed
component name, but it does not change that JSX source location.
- After changing extension files, run
npm run buildand click Reload on the extension card inchrome://extensions. - If the badge displays
ONbut an old extension version is still active, reload the extension and the inspected localhost page, then toggle the extension off and on. - Open the extension card's Errors section if Chrome reports a blocked script or invalid manifest.
- If every source button is disabled, confirm that
code-inspector-pluginis both installed and registered innext.config.tsor the project's bundler configuration. Restart the development server after registering it. - If the source button reports an error, confirm that the development server
using
code-inspector-pluginis still running.
- React internals are private implementation details and can change between React versions.
- Components with debug source paths under
node_modulesare skipped. React 19 does not always expose source paths, so dependency filtering falls back to known framework and Radix UI implementation names in those cases. This fallback includes generated collection wrappers and low-level components such asMenuAnchor,PopperAnchor, andFocusScope. - Component names may be unavailable in minified production builds.
- Host DOM rendered by portals or third-party renderers can produce an unknown result.
- If no meaningful component can be identified, the tooltip displays
Unknown React component.
Releases are managed by Release Please through
.github/workflows/release.yml.
The workflow uses the RELEASE_PLEASE_TOKEN repository secret when available.
This should contain a GitHub personal access token with permission to manage
contents and pull requests for this repository.
Use Conventional Commit messages so changes are grouped correctly:
fix: correct component name resolution
feat: add iframe inspection support
feat!: change the extension activation behavior
fix:creates a patch release.feat:creates a minor release.- A type followed by
!creates a major release.
On pushes to master, Release Please creates or updates a release pull
request containing the version bump and generated CHANGELOG.md. Merging that
pull request creates the vX.Y.Z tag and GitHub Release. The workflow also
builds, tests, and attaches a loadable extension ZIP to the release.