Skip to content

Tour

Tour provides a guided walkthrough of an application's key features and functions, helping users understand and navigate the interface effectively.

Usage

Use the tour to guide users through a series of steps or features within an application, offering contextual information and instructions to enhance the user experience.

Tour

When to use

  • To introduce new users to the application and its primary features.
  • To guide users through a new workflow.
  • To highlight significant updates or changes in the interface.
  • To provide in-app training or onboarding for users.

Best practices

  • Keep tours between 3 and 15 steps.
  • Each step should have a clear and concise description.
  • Focus on how the feature or function can benefit the user.
  • Organize the tour steps in a logical sequence that mirrors the user’s workflow.
  • Avoid overwhelming users with too much information at once.

Design

Elements

Tour elements

  1. Step number, 2. Title, 3. Description, 4. Actions, 5. Arrow (optional), 6. Close button

Tours can be automatically launched for new users during their first login to guide them through the UI. Automatic tours are best for first-time use only.

Users can access guided tours anytime from the Help menu in the application header.

If more than one tour is offered, they can be organized within the Help menu into categories such as "Getting started", "Advanced features" or "New features" for easy navigation.

Tour trigger

Tour beginning and end

The first step gives a brief overview of what to expect from the tour, with the option to skip it. The last step concludes the tour, summarizing key points and optionally offering additional resources.

Tour steps

Placement

The tour popover is automatically positioned above, below, to the left, or to the right of an element based on its screen position. The arrow can be placed along any edge to ensure optimal positioning.

Code

Usage

import { SiTourService } from '@siemens/element-ng/tour';

@NgModule({
  imports: [SiTourService, ...]
})

SiTourService API Documentation

provided in root
✓

Attributes and Methods

Name Type Default Description
addSteps(...)
(steps: TourStep[]) => void Add steps to the tour

Parameters
clearSteps()
() => void Clear all steps
complete()
() => void Finish the tour
(readonly) onTourCancel
Subject<void> ... Event triggered after the tour is cancelled, either through skip button or closing the tour dialog.
(readonly) onTourComplete
Subject<void> ... Event triggered after the tour is completed.
setOptions(...)
(options: TourOptions) => void Sets options for the whole tour.

Parameters
start()
() => void Start the tour

Types Documentation

Options for each tour step.
Properties
The element, the step should be attached to on the page.
attachTo?: { element: (string | HTMLElement | () => (string | HTMLElement)) }
A function that returns a promise. When the promise resolves, the next step will be shown. This can be used to 'clean up' action from beforeShowPromise .
beforeNextPromise?: () => Promise<any> from beforeNextPromise
A function that returns a promise. When the promise resolves, the step will be shown. E.g. use this to open dialogs, etc.
beforeShowPromise?: () => Promise<any> from beforeShowPromise
Unique id for the step. Exposed in DOM as data-step-id
id?: string
Alt text for a provided image.
imgAlt?: TranslatableString
CSS class applied to the image.
imgClass?: string
Sets the image object-fit CSS property.
imgObjectFit?: ("fill" | "none" | "contain" | "cover" | "scale-down") = 'scale-down'
Optional image source to display.
imgSrc?: string
Whether Scroll the element into view.
scrollTo?: (boolean | ScrollIntoViewOptions) from scrollTo
Custom handler to perform scrolling.
scrollToHandler?: (element: HTMLElement) => void from scrollToHandler
Body text of the modal.
text?: TranslatableString
Title to be displayed on the modal.
title: TranslatableString
Options for tour
Properties
Default options applied to all tour steps.
defaultStepOptions?: TourStepCommonOptions
Common options for tour step and as default for tour step
Properties
A function that returns a promise. When the promise resolves, the next step will be shown. This can be used to 'clean up' action from beforeShowPromise .
beforeNextPromise?: () => Promise<any>
A function that returns a promise. When the promise resolves, the step will be shown. E.g. use this to open dialogs, etc.
beforeShowPromise?: () => Promise<any>
Whether Scroll the element into view.
scrollTo?: (boolean | ScrollIntoViewOptions)
Custom handler to perform scrolling.
scrollToHandler?: (element: HTMLElement) => void
Represents a translatable string. This can either be a translation key, e.g. ACTIONS.EDIT that will be automatically translated when displayed on the UI or a pre-translated string, e.g. Edit . Equivalent to a normal string in usage and functionality.

Except where otherwise noted, content on this site is licensed under MIT License.