API Reference
Explore the complete API documentation for MonkeyJs.
Core API
Tour Class
The main class for creating and controlling tours. It manages the tour lifecycle, including initialization, starting, and cleanup, and provides methods to interact with the tour programmatically.
Constructor
new Tour(config: TourConfig, theme?: Partial<ThemeType>)
Creates a new tour instance with the provided configuration.
Methods
initTour(): void // Initializes the tour with the configured steps.
start(): Promise<void> // Starts the tour if it's not already started.
destroy(): void // Ends and destroys the current tour.
Properties
isTourActive: boolean
Returns true if the tour is currently active.
React API
TourContext Component
React context provider for the tour functionality. Wrap your application with this component to enable tour features in your React components. you can access the tour context using the `useTourContext` hook.
Props
steps: stepComponent[] // Array of tour steps to be displayed.
config: PopoverBuilderConfig // Configuration for the popover builder.
theme?: Partial<ThemeType> // Optional theme customization for the tour UI.
children: React.ReactNode // Child components that will have access to the tour context.
useTourContext Hook
React hook to access tour functionality within components.
Returns
{
start: () => Promise<void>,
isTourActive: boolean,
distroy: () => void
}
Types Reference
For detailed type definitions, please refer to the complete Types Documentation.