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

@ai-guide/react

v0.15.14

Published

React components for AI Guide.

Readme

@ai-guide/react

AI-powered UI guidance component for React applications. Help your users navigate your application with natural language queries.

✨ SSR-Safe - Fully compatible with Next.js, Remix, and other SSR frameworks with zero configuration.

Installation

npm install @ai-guide/react
# or
pnpm add @ai-guide/react
# or
yarn add @ai-guide/react

Quick Start

Next.js App Router (SSR-Safe)

// app/layout.tsx
import { AiGuide } from '@ai-guide/react';
import '@ai-guide/react/styles.css';

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        {children}
        <AiGuide projectId="your-project-id" />
      </body>
    </html>
  );
}

Next.js Pages Router

// pages/_app.tsx
import { AiGuide } from '@ai-guide/react';
import '@ai-guide/react/styles.css';

export default function App({ Component, pageProps }) {
  return (
    <>
      <Component {...pageProps} />
      <AiGuide projectId="your-project-id" />
    </>
  );
}

Vite / Create React App

import { AiGuide } from '@ai-guide/react';
import '@ai-guide/react/styles.css';

function App() {
  return (
    <>
      <YourApplication />
      <AiGuide projectId="your-project-id" />
    </>
  );
}

Features

  • ✨ Natural language interface for user guidance
  • 🎯 Real-time element highlighting with Shadow Realm isolation
  • 📝 Step-by-step interactive instructions
  • 🔒 Built-in safety validation and confidence scoring
  • 🌐 100% SSR-safe - Works with Next.js, Remix, Gatsby, etc.
  • 🎨 Complete z-index isolation (no conflicts)
  • 🪝 React hooks for programmatic control
  • 🔄 Version handshake protocol (prevents stale builds)
  • 🚀 Lazy loaded for optimal performance

Usage

Basic Setup

Add the AiGuide component to your application (it renders a floating help bubble):

import { AiGuide } from '@ai-guide/react';

function App() {
  return (
    <>
      <YourApplication />
      <AiGuide 
        projectId="your-project-id"
        apiUrl="https://your-backend.com/api/guide"
      />
    </>
  );
}

The component is automatically SSR-safe - no additional configuration needed!

Programmatic Usage with Hooks

import { useAiGuide } from '@ai-guide/react';

function MyComponent() {
  const { guide, isLoading, error } = useAiGuide();

  const handleHelp = async () => {
    await guide('How do I export my data?');
  };

  return (
    <button onClick={handleHelp} disabled={isLoading}>
      {isLoading ? 'Loading...' : 'Get Help'}
    </button>
  );
}

Tagging Elements

Add data-aid attributes to make elements easily discoverable:

<button data-aid="submit-form">Submit</button>
<input data-aid="email-input" type="email" />
<div data-aid="export-menu">Export Options</div>

API

AiGuide Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | projectId | string | required | Your AI Guide project ID | | apiUrl | string | optional | Custom backend API endpoint | | useShadowDOM | boolean | false | Enable Shadow DOM for complete CSS isolation |

useAiGuide Hook

Returns an object with:

  • guide(query: string) - Start a guidance flow with a natural language query
  • isLoading: boolean - Whether a guidance request is in progress
  • error: Error | null - Any error that occurred
  • currentStep: number - Current step index in the guidance flow
  • totalSteps: number - Total number of steps
  • reset() - Reset the guidance state

Example Queries

Users can ask questions like:

  • "How do I submit the contact form?"
  • "Where is the export button?"
  • "How do I enable email notifications?"
  • "Show me how to delete my account"

SSR Compatibility

This package is 100% SSR-safe out of the box. It uses:

  • React.lazy() for code splitting
  • Client-side only rendering
  • Runtime guards for browser APIs

See SSR Safety Documentation for details.

Requirements

  • React 18.0.0 or higher (React 19 supported)
  • Node.js 18.0.0 or higher

Related Packages

License

MIT