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

branch-beacon-element

v1.0.0

Published

A friendly little git branch indicator for the corner of your dev client. Color-coded so working branches feel safe and protected ones stand out. Vanilla Web Component for any framework or plain HTML.

Downloads

564

Readme

branch-beacon-element

A friendly little git branch indicator that lives in the corner of your dev client. It's color-coded, so working branches feel safe and protected ones stand out. Vanilla Web Component (<branch-beacon>) for any framework or plain HTML — see branch-beacon for the React variant.

branch-beacon in a header

<script type="module">
  import "branch-beacon-element";
</script>

<branch-beacon></branch-beacon>

That's it. The element fetches the current branch from /api/dev/git-branch, classifies it (main / dev / feat/* / fix/* / other), picks a color from the host project's CSS variables (or sensible fallbacks), and renders a Shadow-DOM-isolated indicator. In production builds, it renders nothing.

Install

npm install branch-beacon-element

For React, use branch-beacon instead.

Attributes

<branch-beacon
  endpoint="/api/dev/git-branch"
  shape="dot"
  marker-size="10"
  glow
  poll-ms="30000"
  enabled="true"
  colors='{"main":"#ff0066"}'
></branch-beacon>

glow (boolean attribute) applies a CSS drop-shadow to the marker — works on every shape including the inline SVG glyph. Tune the radius via --branch-glow.

Custom icon

Project content into the icon slot to replace the built-in glyph entirely:

<branch-beacon>
  <svg slot="icon" viewBox="0 0 16 16" fill="currentColor" width="16" height="16">
    <!-- your icon here -->
  </svg>
</branch-beacon>

shape is ignored when slotted content is present; glow and color theming still apply.

Full attribute reference, theming guide (CSS custom properties, ::part()), and live Storybook demo: github.com/MiguelDotL/branch-beacon

Theming via CSS custom properties

branch-beacon {
  --branch-main: #ff0066;
  --branch-dev: #00ccff;
}

The default color tokens are nested var() chains that fall through to the host project's existing palette tokens (--color-danger, --color-success, --color-rose-400, etc.) — drop in and it picks up your design tokens automatically.

External styling via ::part

branch-beacon::part(marker) { /* ... */ }
branch-beacon::part(label)  { /* ... */ }

Production

Hidden by default — auto-detected via process.env.NODE_ENV === "production".

<branch-beacon enabled="true"></branch-beacon>   <!-- force-show -->
<branch-beacon enabled="false"></branch-beacon>  <!-- force-hide -->

License

MIT