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

element-identifier

v1.0.3

Published

Generate stable, unique CSS selectors to identify DOM elements.

Readme

element-identifier

version: 1.0.2

Generate stable, unique CSS selectors to identify DOM elements — and use a Web Component to inspect and pick them visually.

How to use (CDN + Web Component)

  1. Add the script tag (ESM) to your HTML (head or before):
  • CDN : https://cdn.jsdelivr.net/npm/element-identifier/dist/index.esm.js
<script type="module" src="https://cdn.jsdelivr.net/npm/element-identifier/dist/index.esm.js"></script>
  1. Place the Web Component tag anywhere in the page:
<element-identifier></element-identifier>

That’s it. Load the page and you’ll see a floating button (wheel). Activate it to hover and click elements; the panel will show the selector and details.

Optional attributes (no JavaScript needed)

Use attributes on the tag to control behavior:

<element-identifier active="false" show-wheel="true" show-panel="true"></element-identifier>
  • active: true | false (default false) — start activated.
  • show-wheel: true | false (default true) — show the floating button (wheel).
  • show-panel: true | false (default true) — allow the info panel.
  • auto-start: alias for active.

Notes

  • If you don’t see the button, verify the CDN script loaded and no blockers prevented it.
  • You can toggle the tool from the on-screen controls. No additional JS is required for basic use.

Recommendation: use data-component

For more stable, human- and tool-friendly selectors, add a data-component attribute to your component root or key nodes (e.g., product card, image, or button).

Example:

<div class="card" data-component="ProductCard">
  <img src="/img.jpg" alt="..." data-component="ProductImage" />
  <button data-component="AddToCartButton">Add to cart</button>
</div>

React usage (Example)

If you use React, you can load the Web Component dynamically to ensure the custom element is defined before rendering it.

import {useEffect} from "react";

declare global {
    namespace JSX {
        interface IntrinsicElements {
            'element-identifier': {
                active?: string;
                'show-wheel'?: string;
                'show-panel'?: string;
            };
        }
    }
}

export default function Home() {
    useEffect(() => {
        import('element-identifier');
    }, []);
  return (
    <main>    
        <element-identifier
            active="false"
            show-wheel="true"
            show-panel="true"
        />
    </main>
  );
}
  • The dynamic import registers the custom element (<element-identifier>) in the browser when the component mounts.
  • You can then use the tag directly in your JSX with the optional attributes.

Screenshot

Element Identifier demo (React Counter)