Reactour Sample

Content Type: Sample
Categories: Utility,User Interface,Data

Overview

React Tour - Sample is a ready-made module that shows the React Tour widget working in Mendix Studio Pro 10.24.17. Import it, give your user roles the module role of ReactTourSample, and add the page ReactTourSample.Home_Web to the navigation. When the page opens, a guided tour starts on Button 1 and walks through the buttons and text blocks on the page.

The tour dims the page, highlights one element at a time and shows a popover with the step text. Users move through the steps with the arrow buttons, the dots or the arrow keys. They close the tour with the X button or Esc.

The module shows how to set up a tour yourself:

- The steps are JSON text in a String attribute of the Helper entity.

- The target elements get a CSS class in Studio Pro.

- The microflow DS_Helper fills the steps and switches the tour on. It also sets the look: accent colour, arrows, close button, dots and step badge.

Use it to see the widget working before you add it to your app, to learn the Steps JSON format, or as a starting point for your own onboarding tour.

Documentation

Typical usage scenario

React Tour - Sample is a ready-made example module for the React Tour widget. It contains one page with a working five-step guided tour, the helper entity that holds the tour settings, and the microflow that fills them. Import it to see the widget working in your own app in a few minutes.

Problems it solves:

- Setting up a first tour takes guesswork: which attributes to create, how to write the Steps JSON, and how to point steps at elements. The sample shows all of it on one page.

- Checking the widget after an upgrade is easier on a clean reference page.

Where it's useful:

- Evaluating React Tour before adding it to your app

- Learning the Steps JSON format and the CSS-class approach for target elements

- A starting point for your own onboarding or feature tour

- Demos and training

Features and limitations

Features:

- Page ReactTourSample.Home_Web with three buttons and text blocks. The tour starts automatically on Button 1.

- A five-step tour with steps for .custombutton1, .custombutton2, .custombutton3, .class4 and .class8.

- Entity Helper, with one attribute per widget setting: Steps, StartTour, accent colour, the show/hide settings, Start At and focus lock.

- Microflow DS_Helper, which fills the steps, starts the tour and sets the look:

- accent colour #ffc400

- arrows, close button, dots and step badge on

- start at step 1

- Navigation with the arrow buttons, dots or arrow keys; close with the X button or Esc.

- Includes React Tour widget 2.1.0, which works in the Mendix 10 React client.

Limitations:

- The tour settings are fixed in DS_Helper. Change them in Studio Pro to try other options.

- The target elements must be on the page when the tour opens.

- Web only; native mobile is not supported.

Dependencies

- Mendix Studio Pro 10.24.17 or a later 10.24 version

Installation

1. Download ReactTourSample.mpk from the Marketplace or from the GitHub release Sample-Version2.1.0.

2. In Studio Pro, choose App > Import module package and select the file. Press F4 if the widget doesn't appear in the Toolbox yet.

3. Open App > Security > User roles and give the roles that should use the page the module role of ReactTourSample.

4. Add the page ReactTourSample.Home_Web to the navigation.

5. Run the app and open the page. The tour starts on Button 1.

Configuration

The sample needs no configuration. To change the tour or reuse it:

1. Open the microflow DS_Helper and change the Steps JSON, for example:

[{"selector": ".custombutton1", "content": "This is my custom button 1"}]

2. Give each element you want to highlight a class in Studio Pro (Properties > Appearance > Class), matching the selector in the JSON.

3. Change the other values in DS_Helper to try the settings, for example Show Close Button = false to hide the X, or Start At = 2 to start at the third step.

4. To use it in your own page, copy the Helper attributes to your entity (or keep Helper as a helper entity), place the widget in a data view, and set Start Tour to true when the tour should open.

Known bugs

No known bugs.

Report issues at https://github.com/bharathidas/Reactour/issues

Frequently Asked Questions

Is this the widget itself?

It's a sample module that includes the widget. If you only need the widget, download React Tour from its own Marketplace listing.

The tour doesn't start. What should I check?

Make sure your user role has the module role of ReactTourSample and that you opened the page ReactTourSample.Home_Web. The tour opens when the page loads.

How do I open the tour again after closing it?

Reload the page. In your own app, set Start Tour to true again, for example from a button. The widget sets it back to false when the tour closes.

What changed from the Mendix 9 sample?

The Mendix 9 sample was a complete app (GitHub release version2). This version is a module package for Studio Pro 10.24.17 that you import into your own app, and it includes widget 2.1.0.

Releases

Version: 2.1.0
Framework Version: 10.24.17
Release Notes:

## React Tour 2.1.0


Guided feature tour widget (reactour 1.19.2), rebuilt and tested for **Mendix Studio Pro 10.24.17** (React client).


### Compatibility

- Mendix Studio Pro 10.24.17 (tested on 10.24.17.102810), web, React client.

- Built with Mendix pluggable widgets tools 10.16.0.


### Changes and fixes

- **Breaking change:** *Close With Mask, Show Buttons, Show Close Button, Show Navigation, Show Navigation Number* and *Show Number* now follow their attribute. In 1.0.0 they were always on. If the attribute is `false`, that control is now hidden. To keep the old look, set the attribute to `true`.

- Show Navigation Number is now passed to the tour.

- The tour can be opened again: closing it sets Start Tour back to `false`; setting it to `true` reopens the tour.

- Empty or invalid Steps JSON no longer breaks the page (the tour is not shown and an error is logged in the browser console).

- Start At is kept inside the range of steps.

- Package size reduced from 627 KB to 74 KB.


### Install or upgrade

1. Download `mendix.Reacttour.mpk` below and put it in the `widgets` folder of your app (replace the old file when upgrading).

2. In Studio Pro choose **App > Update all widgets**.

3. When upgrading, check the six Boolean settings above.

4. If the old widget still shows, use **App > Clean Deployment Directory**.


### Sample module

[ReactTourSample.mpk](https://github.com/bharathidas/Reactour/raw/main/ReactTourSample.mpk) - import with **App > Import module package**, give your user role the module role, and add `ReactTourSample.Home_Web` to the navigation.


### Previous versions

- [version1](https://github.com/bharathidas/Reactour/releases/tag/version1): widget 1.0.0 for Mendix 9.

- [version2](https://github.com/bharathidas/Reactour/releases/tag/version2): Mendix 9 sample app package (`ReactTour.mpk`).

Version: 1.0.0
Framework Version: 9.12.4
Release Notes: Create customizable guided tours to improve user onboarding and feature discovery, highlighting elements with dynamic tooltips and offering flexible navigation and styling options. **Dependencies**: • Mendix modeler 9.12.4. **Features** • Steps: Array of elements to highlight with special info **Example**: '[ { "**selector**": ".custombutton1", "**content**": "This is my custom button 1.Ok, lets start with the name of the Tour that is about to begin." }, { "**selector**": ".custombutton2", "**content**": "This is my custom button 2" }, { "**selector**": ".custombutton3", "**content**": "buttons test" } ]' **Selector**: ClassName **Content**: Content to be shown for that selector • **Start Tour**: To start the Tour. • **Accent Color**: Custom color for numbers and dots. • **Close With Mask**: Close the Tour by clicking the Mask • **Disable Dot Navigation**: The attribute to disable dots navigation • **Disable Keyboard Navigation**: The attribute to disable keyboard navigation. • **Show buttons**: Show/Hide Helper Navigation buttons • **Show Close button**: Show/Hide Helper Close button • **Show Navigation**: Show/Hide Helper Navigation Dots • **Show Navigation Number**: Show/Hide number when hovers on each Navigation Dot • **Show Number**: Show/Hide Helper Number Badge • **Start At**: Starting step when Tour is open the first time • **Disable Focus Lock**: Disable FocusLock component **Issues, suggestions and feature requests** https://github.com/bharathidas/Reactour/issues