NextStep
A lightweight onboarding library for React Router applications.
Create engaging, interactive product tours with ease.
Why Choose NextStep?
Native React
Built with React from the ground up for full compatibility with your React Router applications.
Motion Animations
Smooth, customizable animations powered by Framer Motion for engaging user experiences.
Interactive
Trigger tour steps based on user interactions with forms and other elements for dynamic, interactive experiences.
Fully Customizable
Provide your own custom card components to completely control the appearance of your tours. Customize animations, styling, and behavior.
Lightweight
Minimal bundle size with zero dependencies beyond Motion for fast loading times.
Cross-Page Routing
Create tours that span multiple pages with built-in navigation adapters for Next.js, React Router, and Remix.
Event Callbacks
Track user progress with callbacks for analytics and custom behaviors. Perform actions when a step is started, completed, skipped, or when the tour is finished.
See NextStep in action
Get Started
Install NextStep
Add NextStep to your project with your preferred package manager
Built with
We are improving NextStep.
Sign up to hear about our latest updates:
Quick Start Guide
- Install NextStep in your project using npm, yarn, or pnpm.
- Wrap your app with the NextStepProvider and use the React Router adapter:
//app/root.tsx import { NextStepProvider, NextStepReact } from 'nextstepjs'; import { useReactRouterAdapter } from 'nextstepjs/adapters/react-router'; import { Outlet } from 'react-router-dom'; const steps = [ { tour: "mainTour", steps: [ { icon: "👋", title: "Welcome", content: "Let's get started with NextStep!", selector: "#step1", side: "right", showControls: true, showSkip: true }, // More steps... ] } ]; export default function App() { return ( <NextStepProvider> <NextStepReact navigationAdapter={useReactRouterAdapter} steps={steps}> <Outlet /> </NextStepReact> </NextStepProvider> ); }
Vite Configuration
⚠️ Important: If you're using Vite with React Router, add the following configuration to your `vite.config.ts`:
// vite.config.ts import { defineConfig } from 'vite'; export default defineConfig({ ssr: { noExternal: ['nextstepjs', 'motion'] } });
- Define your steps:
import { Tour } from 'nextstepjs'; const steps : Tour[] = [ { tour: "mainTour", steps: [ { title: "Welcome", content: "Let's get started with NextStep!", selector: "#step1", // ... other step properties }, // ... more steps ] } ];
- Add id attributes to your HTML elements to target them in your steps.
- Use NextStep hook to control the tour from your components.
import { useNextStep } from 'nextstepjs'; const MyComponent = () => { const { startNextStep, closeNextStep, currentTour, currentStep, setCurrentStep, isNextStepVisible } = useNextStep(); const handleStartTour = () => { startNextStep("mainTour"); }; return ( <button onClick={handleStartTour}>Start Tour</button> ); };
Frequently Asked Questions
What is NextStepjs?
NextStepjs is an open-source, lightweight onboarding library designed for React Router applications. It enables developers to create engaging, interactive product tours with ease, enhancing user experience and facilitating seamless onboarding processes.
How do I install NextStepjs in my React Router project?
To install NextStepjs, use your preferred package manager. For example, with npm, run: npm install nextstepjs motion. This command installs both NextStepjs and Framer Motion, which is utilized for smooth animations.
How do I get started with NextStepjs?
To get started with NextStepjs, first install the package using your preferred package manager. Then, wrap your React Router application with the NextStepProvider and define your onboarding steps. Check the Docs for detailed setup instructions.