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

ng-beacon

v0.1.0

Published

Lightweight guided-tour library for Angular 19+ with signal-based state, SVG spotlight overlays, keyboard navigation, and i18n support.

Readme

ng-beacon

Lightweight guided-tour library for Angular 19+ with Angular Signals and zoneless-compatible rendering.
SVG spotlight overlays, keyboard navigation, and lightweight i18n hooks with zero runtime dependencies beyond Angular.

Animated demo: View the GitHub README demo or open the GIF directly.

Install

npm install ng-beacon

Stackblitz Demo

https://stackblitz.com/edit/stackblitz-starters-midtdjmx

Quick Start

// app.config.ts
import { provideBeacon } from 'ng-beacon';

export const appConfig = {
  providers: [provideBeacon()],
};
<!-- app.component.html -->
@if (beaconService.isActive()) {
  <beacon-overlay />
}
// Define steps
const TOUR: BeaconStep[] = [
  { id: 'welcome', title: 'Welcome!', content: 'Let me show you around.', position: 'center', showWithoutTarget: true },
  { id: 'nav', title: 'Navigation', content: 'Use the sidebar to navigate.', position: 'end', selector: '[data-tour="sidebar"]' },
];

// Start a tour directly (snapshot — steps are fixed for the tour's lifetime)
this.beaconService.start(TOUR);

// Or start from all registered context steps (reactive — steps from
// destroyed components are automatically pruned from the running tour)
this.beaconService.startContextTour();

Component-scoped step registration

Components can register steps that are automatically added to and removed from the context registry:

import { registerTourSteps, BeaconStep } from 'ng-beacon';

const MY_STEPS: BeaconStep[] = [
  { id: 'feature', title: 'New Feature', content: 'Check this out!', position: 'below', selector: '[data-tour="feature"]' },
];

@Component({ /* ... */ })
export class FeatureComponent {
  private readonly _tour = registerTourSteps(MY_STEPS); // auto-unregisters on destroy
}

When a component with registered steps is destroyed during an active context tour, those steps are automatically removed from the running tour and the step index adjusts accordingly.

If UI changes cause previously hidden elements to appear (or visible ones to disappear), call beaconService.recalculate() to rebuild the active context tour. The current step is preserved by id.

If your app uses Angular Router and you want tours to close after route changes, subscribe to NavigationEnd and call beaconService.stop() from app-level code.

See the full documentation for i18n, theming, component-scoped registration, and API reference.

Keyboard support includes Escape to close, ArrowLeft to go back, and ArrowRight to advance.

Events

BeaconService exposes two signals for tracking tour lifecycle:

  • finished — emits when the user completes all steps (clicks next on the last step)
  • dismissed — emits when the tour is closed early (close button, Escape, click outside, or programmatic stop())

Both are Signal<BeaconTourEvent | null>, starting as null. Each emission is a new object, so effect() fires every time.

interface BeaconTourEvent {
  step: BeaconStep;    // the step that was active when the event fired
  stepIndex: number;   // zero-based index
  totalSteps: number;  // total steps in the tour
}

Usage

import { effect, inject } from '@angular/core';
import { BeaconService } from 'ng-beacon';

export class AppComponent {
  private readonly beaconService = inject(BeaconService);

  constructor() {
    effect(() => {
      const event = this.beaconService.finished();
      if (event) {
        localStorage.setItem('tour-completed', 'true');
      }
    });

    effect(() => {
      const event = this.beaconService.dismissed();
      if (event) {
        console.log(`Tour dismissed at step ${event.stepIndex + 1}/${event.totalSteps}`);
      }
    });
  }
}

License

MIT