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, anduseTourhook will be added to your project undercomponents/tour.tsx. - Additional step IDs will be added under
lib/tour-constants.tsfor reference. - Wrap your app with
TourProviderinapp/layout.tsxor desired file. - Utilize the
setStepsfunction from theuseTourhook to highlight specific steps. - Use
TourAlertDialogcomponent 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.