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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ngxsmk-help-tour

v1.0.0

Published

Angular 17+ standalone help/spotlight tour (overlay, beacons, keyboard, a11y)

Readme

✨ ngxsmk-help-tour

Angular 17+ standalone help/spotlight tour library — highlight elements (spotlight-only) or show guided cards with next/prev controls. Lightweight, a11y‑friendly, and SSR‑aware.

npm version downloads angular version license


🚀 Features

  • 🧩 Standalone Angular component (no NgModule) + simple service API
  • 🔦 Spotlight-only focus or full Card tour mode
  • ⌨️ Keyboard nav: ← → / Enter / Esc
  • 🕒 Auto‑advance between steps (autoAdvanceMs) with optional pause on hover
  • 🖱 Click‑through control on mask (block/allow background clicks)
  • 🟢 Shape presets: rect or circle, per‑step padding + border radius
  • 🧭 Viewport aware card positioning (top/bottom/left/right/auto)
  • Accessible (dialog semantics in card mode, close with Esc)
  • 🧪 SSR‑friendly (no direct DOM in service; guarded usage in component)

📦 Install

  npm i ngxsmk-help-tour

Requires Angular 17+.


🔧 Setup

Add the overlay host once near the root of your app:

<ngxsmk-help-tour></ngxsmk-help-tour>

✴️ Spotlight‑only (focus) — one‑liner

Use focus(target, options?) to highlight any element without showing a card:

import { Component } from '@angular/core';
import { HelpTourService } from 'ngxsmk-help-tour';

@Component({ selector: 'app-demo', standalone: true, template: `
  <button id="hero-cta" (click)="highlight()">Hero CTA</button>
  <ngxsmk-help-tour></ngxsmk-help-tour>
`})
export class DemoComponent {
  constructor(private tour: HelpTourService) {}
  highlight() {
    this.tour.focus('#hero-cta', {
      padding: 12,
      shape: 'rect',            // or 'circle'
      maskOpacity: 0.7,
      // autoAdvanceMs: 2000,    // uncomment to auto-close after 2s
      allowClose: true,
    });
  }
}

🧭 Full Card Tour

Define steps and start a guided tour with titles/content and navigation.

import { Component } from '@angular/core';
import { HelpTourComponent, HelpTourService, TourStep } from 'ngxsmk-help-tour';

@Component({
  selector: 'app-card-demo',
  standalone: true,
  imports: [HelpTourComponent],
  template: `
    <button id="hero-cta" (click)="startTour()">Start Tour</button>
    <a id="profile-btn">Profile</a>
    <div id="side-nav">Sidebar</div>
    <ngxsmk-help-tour></ngxsmk-help-tour>
  `
})
export class CardDemoComponent {
  constructor(private tour: HelpTourService) {}
  startTour() {
    const steps: TourStep[] = [
      { id: 'welcome', target: '#hero-cta', title: 'Welcome', content: 'Click here to begin', placement: 'bottom', padding: 10 },
      { id: 'nav', target: '#side-nav', title: 'Navigation', content: 'Use the sidebar to switch sections', placement: 'right' },
      { id: 'profile', target: '#profile-btn', title: 'Profile', content: 'Manage your account here', placement: 'top', shape: 'circle' }
    ];
    this.tour.start(steps, { mode: 'card', maskOpacity: 0.6, storageKey: 'help-tour-v1' });
  }
}

⚙️ API

HelpTourService

  • start(steps: TourStep[], options?: TourOptions) — start a tour
  • focus(target, options?)spotlight‑only single step (no card)
  • next() / prev() / close(completed?: boolean)
  • goTo(indexOrId) — jump to a specific step
  • startIfNotCompleted(steps, options?) — respects storageKey
  • setOptions(partial) — update global options at runtime
  • Signals (readonly): active, current, currentIndex, count, options

TourStep

{
  id: string;
  target: string | ElementRef<HTMLElement>;
  title?: string;            // (card mode)
  content?: string;          // (card mode)
  placement?: 'auto'|'top'|'bottom'|'left'|'right';
  offset?: number;           // gap between card and target
  padding?: number;          // spotlight padding
  shape?: 'rect'|'circle';
  borderRadius?: number|string;
  beforeEnter?: () => void|Promise<void>;
  beforeLeave?: () => void|Promise<void>;
  canProceed?: () => boolean|Promise<boolean>;
}

TourOptions

{
  mode?: 'spotlight'|'card';
  maskOpacity?: number;         // 0..1
  allowClose?: boolean;         // esc / mask click
  keyboard?: boolean;           // arrow keys / enter / esc
  clickThrough?: boolean;       // allow background clicks
  autoAdvanceMs?: number;       // auto-next/close after ms
  pauseOnHover?: boolean;       // pause auto-advance on hover
  scrollBehavior?: 'smooth'|'auto';
  storageKey?: string;          // mark completed in localStorage
  waitForSelectorMs?: number;   // poll time for late targets
  theme?: 'light'|'dark';
}

🎨 Theming

Customize via CSS variables (global or scoped to the host):

ngxsmk-help-tour {
  --tour-bg: #111827;        /* card bg (card mode) */
  --tour-fg: #fff;           /* card text */
  --tour-accent: #22d3ee;    /* buttons & spotlight border */
  --tour-mask: rgba(0,0,0,.60);
  --tour-radius: 12px;       /* card radius */
  --tour-shadow: 0 10px 30px rgba(0,0,0,.25);
}

🖼 Demo (optional)

Create a quick demo app and serve:

  ng generate application ngxsmk-help-tour-demo --standalone --routing=false --style=scss
  ng serve ngxsmk-help-tour-demo

Open http://localhost:4200


🧪 Tips

  • For spotlight tours, consider autoAdvanceMs and clickThrough:false for guided focus.
  • If a target may render later (lazy components/routes), set waitForSelectorMs.
  • Use storageKey to run once per user.

🔖 Topics

angular · angular17 · angular-standalone · onboarding · product-tour · spotlight · overlay · a11y · ngxsmk


📄 License

MIT