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

@cloudimage/spotlight

v1.0.5

Published

CDN-native screenshot-based interactive experience player

Readme

@cloudimage/spotlight

CDN-native, screenshot-based interactive experience player. Built as a Web Component (<cloudimage-spotlight>) with zero runtime dependencies.

Part of the Scaleflex plugin ecosystem and the Cloudimage plugin family.

Installation

npm install @cloudimage/spotlight

Script tag (CDN)

<script src="https://unpkg.com/@cloudimage/spotlight/dist/define.min.js"></script>

ES module

import '@cloudimage/spotlight/define';

Manual registration

import { CloudimageSpotlight } from '@cloudimage/spotlight';
customElements.define('my-spotlight', CloudimageSpotlight);

Usage

<cloudimage-spotlight
  config="https://example.com/tour.json"
  theme="dark"
  eager
></cloudimage-spotlight>

Inline config

<cloudimage-spotlight eager>
  <script type="application/json">
    {
      "version": "1.0",
      "ciToken": "your-token",
      "scenes": [
        {
          "id": "step-1",
          "image": "example.com/screenshot.png",
          "title": "Welcome",
          "description": "Get started with our platform.",
          "regions": [{ "tl_x": 0.1, "tl_y": 0.1, "br_x": 0.5, "br_y": 0.5 }]
        }
      ]
    }
  </script>
</cloudimage-spotlight>

JavaScript property

const el = document.querySelector('cloudimage-spotlight');
el.config = { version: '1.0', ciToken: 'demo', scenes: [...] };

React

import { CloudimageSpotlightReact } from '@cloudimage/spotlight/react';

function App() {
  const ref = useRef(null);
  return (
    <CloudimageSpotlightReact
      ref={ref}
      config={tourConfig}
      theme="dark"
      eager
      onReady={(detail) => console.log('Ready:', detail.totalScenes)}
      onSceneChange={(detail) => console.log('Scene:', detail.to)}
      onComplete={(detail) => console.log('Done:', detail.timeSpent)}
    />
  );
}

HTML Attributes

| Attribute | Type | Default | Description | |-----------|------|---------|-------------| | config | string | — | URL to JSON config file | | theme | "dark"\|"light"\|"auto" | "dark" | Color theme | | autoplay | boolean | false | Auto-advance scenes | | autoplay-interval | number | 4000 | Autoplay interval (ms) | | show-progress | boolean | true | Show step counter | | allow-skip | boolean | true | Show skip button | | allow-keyboard | boolean | true | Enable keyboard nav | | sync-url | boolean | false | Sync scene to URL hash | | eager | boolean | false | Disable lazy loading |

Config Schema

interface SpotlightConfig {
  version: "1.0";
  ciToken: string;
  title?: string;
  aspectRatio?: string;                          // e.g. "16:9", "4:3"
  settings?: {
    transition?: "fade" | "slide" | "zoom";
    autoplay?: boolean;
    autoplayInterval?: number;
    maskStyle?: "color" | "blur";
    maskOpacity?: number;
    maskBlurRadius?: number;
    showProgress?: boolean;
    allowSkip?: boolean;
    allowKeyboard?: boolean;
    intro?: boolean | SpotlightIntro;
    outro?: boolean | SpotlightOutro;
    staggerEntry?: boolean;
  };
  scenes: Array<{
    id: string;
    image: string;
    title?: string;
    description?: string;
    regions?: Array<{
      tl_x: number; tl_y: number;  // top-left (0-1)
      br_x: number; br_y: number;  // bottom-right (0-1)
      shape?: "rect" | "ellipse";
      label?: string;
    }>;
    zoom?: boolean;
    mask?: boolean;
    maskStyle?: "color" | "blur";
    cta?: { label: string; href?: string };
    annotation?: {
      position?: "top"|"bottom"|"left"|"right"|"auto";
      style?: "card"|"tooltip"|"minimal";
    };
  }>;
}

Events

| Event | Detail | Description | |-------|--------|-------------| | cis:ready | { totalScenes, config } | Component initialized | | cis:scene-change | { from, to, scene, totalScenes } | Scene navigated | | cis:complete | { totalScenes, timeSpent, config } | Tour completed | | cis:skip | { atScene, scene, totalScenes } | Tour skipped | | cis:cta-click | { scene, cta, metadata } | CTA button clicked | | cis:region-enter | { scene, regions } | Scene with regions entered | | cis:error | { message, code } | Error occurred | | cis:fullscreen-change | { isFullscreen } | Fullscreen mode toggled |

Public Methods

const el = document.querySelector('cloudimage-spotlight');
el.next();           // Next scene
el.prev();           // Previous scene
el.goTo(2);          // Jump to scene index
el.goToId('step-3'); // Jump to scene by ID
el.play();           // Start autoplay
el.pause();          // Pause autoplay
el.destroy();        // Full cleanup
el.reload(config);   // Reset and reload

CSS Custom Properties

All styles are customizable via --cis-* CSS variables:

cloudimage-spotlight {
  --cis-accent: oklch(0.578 0.198 268.129);
  --cis-border-radius: 8px;
  --cis-card-bg: rgba(0, 0, 0, 0.85);
  --cis-transition-duration: 300ms;
  --cis-mobile-breakpoint: 600px;
}

Keyboard Navigation

| Key | Action | |-----|--------| | / Space | Next scene | | | Previous scene | | Escape | Skip tour | | Home / End | First / last scene | | 19 | Jump to scene (≤9 scenes) |

RTL-aware: arrow keys swap in RTL mode.

Accessibility

  • WCAG 2.1 AA compliant
  • role="region" with aria-roledescription
  • aria-live="polite" progress announcements
  • Full keyboard navigation
  • Focus-visible indicators
  • prefers-reduced-motion respected

Browser Support

| Browser | Minimum | |---------|---------| | Chrome / Edge | 73+ | | Firefox | 101+ | | Safari | 16.4+ |

License

MIT