# SiTourService documentation

**Kind:** class

**Provided in:** `root`

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

```
undecorated_class SiTourService
```

#### Attributes and Methods

##### addSteps

[Source for addSteps](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.service.ts#L72-L74>)

Add steps to the tour

```
addSteps(steps: TourStep[]): void
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [steps](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.service.ts#L72-L72>) | `TourStep[]` |  |  |

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

##### clearSteps

[Source for clearSteps](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.service.ts#L79-L82>)

Clear all steps

```
clearSteps(): void
```

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

##### complete

[Source for complete](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.service.ts#L94-L96>)

Finish the tour

```
complete(): void
```

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

##### onTourCancel

[Source for onTourCancel](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.service.ts#L60-L60>)

**Modifiers:** readonly

**Type:** `Subject<void>`

**Default:** `new Subject<void>()`

Event triggered after the tour is cancelled, either through skip button or closing the tour dialog.

##### onTourComplete

[Source for onTourComplete](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.service.ts#L55-L55>)

**Modifiers:** readonly

**Type:** `Subject<void>`

**Default:** `new Subject<void>()`

Event triggered after the tour is completed.

##### setOptions

[Source for setOptions](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.service.ts#L65-L67>)

Sets options for the whole tour.

```
setOptions(options: TourOptions): void
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [options](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.service.ts#L65-L65>) | `TourOptions` |  |  |

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

##### start

[Source for start](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.service.ts#L87-L89>)

Start the tour

```
start(): void
```

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

### Types Documentation

### [TourOptions](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.model.ts#L53-L56>)

**Kind:** interface

```
import type { TourOptions } from '@siemens/element-ng/tour';
```

Options for tour

```
interface TourOptions
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [defaultStepOptions](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.model.ts#L55-L55>) (optional) | `TourStepCommonOptions` | Default options applied to all tour steps. |

### [TourStep](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.model.ts#L28-L50>)

**Kind:** interface

```
import type { TourStep } from '@siemens/element-ng/tour';
```

Options for each tour step.

```
interface TourStep extends TourStepCommonOptions
```

#### Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [attachTo](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.model.ts#L47-L49>) (optional) | `{ element: string \| HTMLElement \| (() => string \| HTMLElement); }` |  | The element, the step should be attached to on the page. |
| [beforeNextPromise](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.model.ts#L24-L24>) (optional, inherited) | `(() => Promise<any>)` |  | 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`.<br><br>Inherited from [TourStepCommonOptions](<index.html#t:TourStepCommonOptions>) |
| [beforeShowPromise](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.model.ts#L18-L18>) (optional, inherited) | `(() => 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.<br><br>Inherited from [TourStepCommonOptions](<index.html#t:TourStepCommonOptions>) |
| [id](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.model.ts#L30-L30>) (optional) | `string` |  | Unique id for the step. Exposed in DOM as `data-step-id` |
| [imgAlt](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.model.ts#L38-L38>) (optional) | `TranslatableString` |  | Alt text for a provided image. |
| [imgClass](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.model.ts#L40-L40>) (optional) | `string` |  | CSS class applied to the image. |
| [imgObjectFit](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.model.ts#L45-L45>) (optional) | `"fill" \| "contain" \| "cover" \| "none" \| "scale-down"` | `'scale-down'` | Sets the image [object-fit](<https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit>) CSS property. |
| [imgSrc](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.model.ts#L36-L36>) (optional) | `string` |  | Optional image source to display. |
| [scrollTo](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.model.ts#L10-L10>) (optional, inherited) | `boolean \| ScrollIntoViewOptions` |  | Whether Scroll the element into view.<br><br>Inherited from [TourStepCommonOptions](<index.html#t:TourStepCommonOptions>) |
| [scrollToHandler](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.model.ts#L12-L12>) (optional, inherited) | `((element: HTMLElement) => void)` |  | Custom handler to perform scrolling.<br><br>Inherited from [TourStepCommonOptions](<index.html#t:TourStepCommonOptions>) |
| [text](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.model.ts#L34-L34>) (optional) | `TranslatableString` |  | Body text of the modal. |
| [title](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.model.ts#L32-L32>) | `TranslatableString` |  | Title to be displayed on the modal. |

### [TourStepCommonOptions](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.model.ts#L8-L25>)

**Kind:** interface

```
import type { TourStepCommonOptions } from '@siemens/element-ng/tour';
```

Common options for tour step and as default for tour step

```
interface TourStepCommonOptions
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [beforeNextPromise](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.model.ts#L24-L24>) (optional) | `(() => Promise<any>)` | 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`. |
| [beforeShowPromise](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.model.ts#L18-L18>) (optional) | `(() => 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. |
| [scrollTo](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.model.ts#L10-L10>) (optional) | `boolean \| ScrollIntoViewOptions` | Whether Scroll the element into view. |
| [scrollToHandler](<https://github.com/siemens/element/blob/main/projects/element-ng/tour/si-tour.model.ts#L12-L12>) (optional) | `((element: HTMLElement) => void)` | Custom handler to perform scrolling. |

### [TranslatableString](<https://github.com/siemens/element/blob/main/projects/element-translate-ng/translate-types/global.types.ts#L18-L18>)

**Kind:** type alias

```
import type { TranslatableString } from '@siemens/element-translate-ng/translate-types';
```

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.

```
type TranslatableString = string & Translatable
```
