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

onboard-flow-engine

v1.0.0

Published

User Onboarding Flow Engine - Build product tours, tooltips, and checklists with progress tracking

Readme

🚀 Onboard Flow Engine

A powerful, beautiful user onboarding library for React with product tours, tooltips, checklists, and advanced analytics.

📸 Screenshots

Tooltip with Spotlight

Tooltip Example

Interactive Checklist

Checklist Example

✨ Features

  • 🎯 Multiple Step Types: Tooltips, modals, spotlights, and checklists
  • 🌓 Dark Mode Support: Auto, light, or dark themes with system preference detection
  • 📊 Progress Tracking: Automatic progress persistence with localStorage
  • 🧪 A/B Testing: Built-in variant testing for flow optimization
  • 📈 Analytics: Track completion rates, user behavior, and flow performance
  • 🎨 Beautiful UI: Smooth animations and customizable themes
  • 🔧 Flexible API: Easy to integrate and customize
  • 💾 Auto-save: Progress automatically saved and restored
  • 🎭 Spotlight Mode: Highlight elements with animated overlays
  • ✖️ Dismissible Overlays: Configurable click-outside-to-dismiss behavior
  • ⌨️ Keyboard Support: Full keyboard navigation and accessibility

📦 Installation

npm install onboard-flow-engine

🚀 Quick Start

import { OnboardingProvider, flowEngine, useOnboarding } from 'onboard-flow-engine';

// 1. Register your flow
flowEngine.registerFlow({
  id: 'welcome-tour',
  name: 'Welcome Tour',
  steps: [
    {
      id: 'step-1',
      type: 'modal',
      title: 'Welcome! 👋',
      content: 'Let us show you around',
      skippable: true,
    },
    {
      id: 'step-2',
      type: 'tooltip',
      title: 'Create New Project',
      content: 'Click here to start a new project',
      target: '#create-button',
      position: 'bottom',
    },
  ],
  theme: {
    primaryColor: '#3b82f6',
    borderRadius: '12px',
    mode: 'auto', // 'light', 'dark', or 'auto'
  },
  dismissOnOverlayClick: true, // Allow users to dismiss by clicking outside
});

// 2. Wrap your app
function App() {
  return (
    <OnboardingProvider>
      <YourApp />
    </OnboardingProvider>
  );
}

// 3. Start the flow
function YourComponent() {
  const { startFlow } = useOnboarding();
  
  useEffect(() => {
    startFlow('welcome-tour');
  }, []);
  
  return <div>Your content</div>;
}

📚 Advanced Usage

Checklist Component

import { Checklist } from 'onboard-flow-engine';

<Checklist
  title="Getting Started"
  items={[
    { id: '1', title: 'Create your first project', completed: false },
    { id: '2', title: 'Invite team members', completed: false },
    { id: '3', title: 'Configure settings', completed: false },
  ]}
  onItemComplete={(itemId) => console.log('Completed:', itemId)}
  theme={{ primaryColor: '#10b981' }}
/>

A/B Testing

import { useABTest } from 'onboard-flow-engine';

function MyComponent() {
  const { variant, results, winningVariant } = useABTest('welcome-tour');
  
  // Start flow with variant
  startFlow('welcome-tour', variant);
  
  // Check results
  console.log('Variant A completions:', results.A);
  console.log('Variant B completions:', results.B);
  console.log('Winner:', winningVariant);
}

Analytics

import { flowEngine } from 'onboard-flow-engine';

// Get completion rate
const rate = flowEngine.getCompletionRate('welcome-tour');
console.log(`${rate}% completion rate`);

// Get all analytics events
const events = flowEngine.getAnalytics('welcome-tour');
console.log('Events:', events);

Dark Mode Support

// Auto mode - follows system preference
theme: { mode: 'auto' }

// Always dark
theme: { mode: 'dark' }

// Always light
theme: { mode: 'light' }

Dismissible Overlays

Control whether users can dismiss tours by clicking outside:

flowEngine.registerFlow({
  id: 'my-tour',
  dismissOnOverlayClick: true, // Users can click outside to dismiss
  steps: [...],
});

When enabled:

  • Clicking the overlay dismisses the tour
  • Close buttons (×) appear on tooltips and modals
  • The tour is marked as "skipped" in analytics

Custom Themes

const customTheme = {
  primaryColor: '#8b5cf6',
  backgroundColor: '#ffffff',
  textColor: '#1f2937',
  borderRadius: '16px',
  fontFamily: 'Inter, sans-serif',
  overlayColor: 'rgba(0, 0, 0, 0.8)',
  spotlightPadding: 12,
  mode: 'auto', // Follows system preference
};

flowEngine.registerFlow({
  id: 'custom-tour',
  name: 'Custom Tour',
  steps: [...],
  theme: customTheme,
});

Step Types

Tooltip

{
  id: 'tooltip-step',
  type: 'tooltip',
  title: 'Feature Name',
  content: 'Description of the feature',
  target: '#element-selector',
  position: 'bottom', // 'top' | 'bottom' | 'left' | 'right'
  skippable: true,
}

Modal

{
  id: 'modal-step',
  type: 'modal',
  title: 'Welcome!',
  content: 'Get started with our platform',
  dismissible: true,
}

Spotlight

{
  id: 'spotlight-step',
  type: 'spotlight',
  title: 'Important Feature',
  content: 'This is a key feature',
  target: '#important-element',
}

Lifecycle Hooks

{
  id: 'step-with-hooks',
  type: 'tooltip',
  title: 'Step Title',
  content: 'Step content',
  onEnter: () => console.log('Step entered'),
  onExit: () => console.log('Step exited'),
  condition: () => userIsLoggedIn(), // Only show if condition is true
}

Flow Callbacks

flowEngine.registerFlow({
  id: 'my-flow',
  name: 'My Flow',
  steps: [...],
  onComplete: () => {
    console.log('Flow completed!');
    // Track completion, show celebration, etc.
  },
  onSkip: () => {
    console.log('Flow skipped');
    // Track skip event
  },
});

🎨 Customization

All components support full theme customization:

  • primaryColor: Main accent color
  • backgroundColor: Background color for tooltips/modals
  • textColor: Text color
  • borderRadius: Border radius for all elements
  • fontFamily: Custom font family
  • overlayColor: Spotlight overlay color
  • spotlightPadding: Padding around highlighted elements

📊 Analytics Events

The engine tracks these events automatically:

  • start: Flow started
  • complete: Step/flow completed
  • skip: Flow skipped
  • next: Next step
  • prev: Previous step
  • dismiss: Modal dismissed

🔧 API Reference

flowEngine

  • registerFlow(config: FlowConfig): Register a new flow
  • getFlow(flowId: string): Get flow configuration
  • getProgress(flowId: string): Get flow progress
  • getCompletionRate(flowId: string): Get completion percentage
  • getABTestResults(flowId: string): Get A/B test results
  • getAnalytics(flowId?: string): Get analytics events
  • resetProgress(flowId: string): Reset flow progress

useOnboarding Hook

  • startFlow(flowId: string, variant?: 'A' | 'B'): Start a flow
  • currentFlow: Current active flow instance
  • progress: Current flow progress

useFlow Hook

  • progress: Flow progress data
  • completionRate: Completion rate percentage
  • analytics: Analytics events for the flow

useABTest Hook

  • variant: Current variant ('A' or 'B')
  • results: Completion counts for each variant
  • winningVariant: Variant with more completions

📄 License

MIT © codecrypt112

🔗 Links

🤝 Contributing

Contributions welcome! Please open an issue or PR on GitHub.

👤 Author

codecrypt112