In-App Guide

A walkthrough guide that allows users to interactively explore all the features within your application.
Installation
To install the in-app-guide package, you can use the following npm command:
npm install in-app-guide
Usage
- Include the JavaScript code in your project.
- Set up the HTML elements for your tour steps.
- Call the
initializeTour function with the tour data to start the tour.
vanilla javascript
const inAppGuide = require('in-app-guide');
require("in-app-guide/src/style.css");
const userTourData = [
];
if (typeof window !== "undefined" && inAppGuide) {
inAppGuide.initializeTourData(tourData, true);
const app = document.getElementById("app")
app.innerHTML += inAppGuide.tourElement;
}
React
import React, { useEffect } from 'react';
import inAppGuide from 'in-app-guide';
import "in-app-guide/src/style.css";
const userTourData = [
];
inAppGuide.initializeTourData(userTourData);
const App = () => {
useEffect(() => {
inAppGuide.showStep(inAppGuide.currentStep);
return () => {
};
}, []);
return (
<div>
<div dangerouslySetInnerHTML={inAppGuide.tourElement} />
{/* Your React app content */}
</div>
);
};
export default App;
Tour Data
The tour data is an array of objects, each representing a step in the tour. Each object has the following properties:
target: The HTML element ID to highlight during the step.
title: Title for the tour step.
description: Description for the tour step.
position: Position of the tooltip relative to the target element.
Example
const userTourData = [
{
target: "element1",
title: "Step 1: Introduction",
description: "Welcome to our website! This is the first step of the tour.",
position: "bottom-center",
},
];
initializeTour(userTourData);
Demo
For a Working demo copy the demo folder and follow the below steps
- Copy the demo folder
- And
cd into the folder
- Run
npm install
- Run
npm run build
- For serving the app, you can serve it with your custom script or run
npm i -g live-server
- and run
live-server and your demo will be running on the http://localhost:8080.
OR
- You can find the demo playaround for vanilla javascript here or for React here
LICENSE
This project is licensed under the MIT License - see the LICENSE file for details.