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

click-to-react-component-next

v2.0.1

Published

option/alt+click React components in the browser to open source files in IDE

Readme

click-to-component-next (aka fork)

npm Release

Option+Click or Alt+Click a Component in the browser to instantly goto the source in your editor.

Next.js Demo

Features

  • Option+Click or Alt+Click opens the immediate Component's source

  • Option+RightClick or Alt+RightClick opens a context menu with the parent Components' props, fileName, columnNumber, and lineNumber

    props

  • Works with frameworks like Next.js, Create React App, & Vite that use @babel/plugin-transform-react-jsx-source

  • Works with RSBuild with plugin-react out of the box

  • Supports vscode & vscode-insiders & webstorm & cursor URL handling

  • Automatically tree-shaken from production builds

  • Keyboard navigation in context menu (e.g. , , )

  • More context & faster than using React DevTools:

    React DevTools

Installation

npm install click-to-react-component-next
pnpm add click-to-react-component-next
yarn add click-to-react-component-next

Even though click-to-react-component-next is added to dependencies, tree-shaking will remove click-to-react-component-next from production builds.

Usage

/src/index.js

+import { ClickToComponent } from 'click-to-react-component-next';
 import React from 'react';
 import ReactDOM from 'react-dom/client';
 import './index.css';
@@ -8,7 +7,6 @@ import reportWebVitals from './reportWebVitals';
 const root = ReactDOM.createRoot(document.getElementById('root'));
 root.render(
   <React.StrictMode>
+    <ClickToComponent />
     <App />
   </React.StrictMode>
 );

Create React App Demo

pages/_app.tsx

+import { ClickToComponent } from 'click-to-react-component-next'
 import type { AppProps } from 'next/app'
 import '../styles/globals.css'

 function MyApp({ Component, pageProps }: AppProps) {
   return (
     <>
+      <ClickToComponent />
       <Component {...pageProps} />
     </>
   )

Next.js Demo

+import { ClickToComponent } from "click-to-react-component-next";
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import "./index.css";

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

Vite Demo

npm install @babel/plugin-transform-react-jsx-source

babel.config.js:

module.exports = {
  presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
  plugins: [
    ...(process.env.BABEL_ENV === 'development'
      ? ['@babel/plugin-transform-react-jsx-source']
      : []),
  ],
}

src/theme/Root.js:

import { ClickToComponent } from 'click-to-react-component-next'
import React from 'react'

// Default implementation, that you can customize
export default function Root({ children }) {
  return (
    <>
      <ClickToComponent />
      {children}
    </>
  )
}

editor

By default, the editor is set to vscode.

But you can choose between webstorm, cursor and vscode-insider too.

-<ClickToComponent />
+<ClickToComponent editor="vscode-insiders" />

If you are using another editor, you can use the getEditorUrl prop to define your own editor.

getEditorUrl

If you want to define your own editor, you can use the getEditorUrl prop to define your own editor. This function will be called with the path, line, and column of the target file.

<ClickToComponent
  getEditorUrl={(path, line, column) => {
    return `my-editor://open?file=${path}&line=${line}&column=${column}`
  }}
/>

Run Locally

Clone the project

gh repo clone alexgorbatchev/click-to-component-next

Go to the project directory

cd click-to-component

Install dependencies

pnpm install

Run one of the examples:

cd apps/cra
pnpm start
cd apps/next
pnpm dev