How multiple named tours work
mainYou can register multiple distinct tours by passing an array of TourDefinition objects to the tours prop on TourProvider. Each definition requires a unique id and an array of steps.
To trigger a specific tour, use the startTour(tourId) method from the useTour hook.
import { TourProvider, TourDefinition } from "@/components/tour";
const tours: TourDefinition[] = [
{ id: "intro", steps: introSteps },
{ id: "advanced", steps: advancedSteps },
];
// Setup Provider
<TourProvider
tours={tours}
onComplete={(tourId) => console.log(`${tourId} completed`)}
>
{children}
</TourProvider>
// Triggering a tour
const { startTour } = useTour();
<button onClick={() => startTour("intro")}>Start Intro Tour</button>