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

@guidejs/ui

v0.0.61

Published

UI components for GuideJS, including the `Guide` tour component.

Downloads

152

Readme

@guidejs/ui

UI components for GuideJS, including the Guide tour component.

Install

pnpm add @guidejs/ui
# or
npm i @guidejs/ui

Peer dependencies required in your app:

  • react (>=18)
  • react-dom (>=18)
  • zod (^3.24.1)

Usage

import React from "react"
import { Guide } from "@guidejs/ui@latest"

export default function App() {
  const steps = [
    {
      id: "welcome",
      description: "Welcome to GuideJS",
      configuration: {
        type: "popover",
        popover: { side: "bottom", align: "start" }
      }
    }
  ]

  return (
    <Guide
      steps={steps}
      isActive={true}
      nextBtnText="Next"
      prevBtnText="Previous"
      doneBtnText="Done"
      onComplete={handleComplete}
      onDismiss={handleDismiss}
    />
  )
}

Exports

  • Guide from @guidejs/ui
  • Additional UI components and helpers used by the tour system

Development

Build the package locally:

pnpm -F @guidejs/ui build
ls -la packages/ui/dist

You should see index.js, index.mjs, and index.d.ts.

Paste-Only Autorun

If you record a tour and paste the exported snippet that sets window.__GuideJs_Tour__, installing this package is enough to auto-run the tour without manually rendering.

Steps:

  1. Install the package:
pnpm add @guidejs/ui
  1. Paste your exported snippet anywhere after your app loads. Example shape:
<script>
  window.__GuideJs_Tour__ = {
    isActive: true,
    steps: [
      { type: "pointer", selector: "#start-button", title: "Click Start" },
      { type: "banner", title: "Welcome", description: "Quick walkthrough" }
    ],
    tour: { id: "welcome-tour" }
  };
</script>
  1. The package detects window.__GuideJs_Tour__ and automatically mounts the guide using React 18 createRoot.

React App Minimal Example

// main.tsx
import React from "react";
import { createRoot } from "react-dom/client";
import App from "./App";

const root = createRoot(document.getElementById("root")!);
root.render(<App />);

// Paste the snippet after your app renders (e.g., in index.html or a bootstrap file)

Vanilla HTML Example

<!doctype html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>GuideJS Autorun Demo</title>
  </head>
  <body>
    <button id="start-button">Start</button>

    <!-- Your app scripts here -->

    <script>
      window.__GuideJs_Tour__ = {
        isActive: true,
        steps: [{ type: "pointer", selector: "#start-button", title: "Click Start" }],
        tour: { id: "welcome-tour" }
      };
    </script>
  </body>
  </html>

Verify publish

npm view @guidejs/ui versions --json
# optional: inspect published types/code on npm website (Code tab)

Notes

  • Ensure react and react-dom peer ranges match your app (React 18/19 supported).
  • Positioning uses @floating-ui/react-dom; ensure CSS resets don’t interfere with overlays.
  • Theme opacity: Exported tours ensure overlayColorOpacity is a finite number (defaults to 30). If setting it manually, provide a number (0–100) to avoid React NaN opacity warnings.

React Integration

Safe initialization, event-driven updates, and one-time run:

import React, { useEffect, useState } from "react";
import { Guide } from "@guidejs/ui";

export default function App() {
  const [steps, setSteps] = useState(window.__GuideJs_Tour__?.steps || []);
  const [hasRun, setHasRun] = useState(
    typeof window !== "undefined" && window.localStorage?.getItem("guidejs_tour_run") === "1"
  );

  useEffect(() => {
    const onLoaded = () => {
      try { setSteps(window.__GuideJs_Tour__?.steps || []); } catch {}
    };
    window.addEventListener("guidejs:tourLoaded", onLoaded);
    return () => window.removeEventListener("guidejs:tourLoaded", onLoaded);
  }, []);

  const handleFinish = () => {
    try {
      window.localStorage?.setItem("guidejs_tour_run", "1");
      setHasRun(true);
    } catch {}
  };

  const handleComplete = () => {
    // Called ONLY when user completes the tour (clicks Done on last step)
    console.log("Tour completed successfully");
    setHasRun(true);
  };

  const handleDismiss = () => {
    // Called when user dismisses the tour early (clicks X button)
    console.log("Tour dismissed");
    setHasRun(true);
  };

  return (
    <>
      {Array.isArray(steps) && steps.length > 0 && !hasRun && (
        <Guide 
          steps={steps} 
          onComplete={handleComplete} 
          onDismiss={handleDismiss}
          isActive={true} 
        />
      )}
    </>
  );
}

Overlay note: opacity defaults to 0 (no dimming). Set overlayColorOpacity: 0 to be explicit.

License

MIT