Overview
The tour
component is a tool designed to facilitate product tours with motion and visual enhancements. It includes key components such as TourProvider
, TourAlertDialog
, and useTour
hook to create engaging and interactive tours for applications.
Features
- TourProvider: Context provider for making the tour available in the app.
- TourAlertDialog: Alert dialog component to start or skip the tour.
- useTour: Hook providing essential tour functions and states.
Installation
To install the tour
component, follow these steps:
- Run the command to install the necessary packages and components:
npm install [package name]
- After installation, components like
TourProvider
,TourAlertDialog
, anduseTour
hook will be added to your project undercomponents/tour.tsx
. - Additional step IDs will be added under
lib/tour-constants.ts
for reference. - Wrap your app with
TourProvider
inapp/layout.tsx
or desired file. - Utilize the
setSteps
function from theuseTour
hook to highlight specific steps. - Use
TourAlertDialog
component to display and navigate through the tour steps.
Summary
The tour
component provides an efficient way to integrate product tours into applications, enhancing user experience with interactive features like motion and visual cues. By leveraging components like TourProvider
, TourAlertDialog
, and useTour
hook, developers can effortlessly create engaging tours with step-by-step guides and interactive dialogues.