Skip to content

Tour

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:108

Class representing the site tour

new Tour(options?): Tour

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:119

TourOptions = {}

Tour

Evented.constructor

bindings: Bindings

Defined in: docs-src/node_modules/shepherd.js/src/evented.ts:11

Evented.bindings


classPrefix: string

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:111


optional currentStep: Step | null

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:112


optional focusedElBeforeOpen: HTMLElement | null

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:113


optional id: string

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:114


optional modal: ShepherdModalAPI | null

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:115


options: TourOptions

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:116


steps: Step[]

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:117


trackedEvents: string[]

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:109

_setupActiveTour(): void

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:402

Make this tour “active”

void


addStep(options, index?): Step | StepOptions

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:165

Adds a new step to the tour

An object containing step options or a Step instance

Step | StepOptions

number

The optional index to insert the step at. If undefined, the step is added to the end of the array.

Step | StepOptions

The newly added step


addSteps(steps?): Tour

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:187

Add multiple steps to the tour

The steps to add to the tour

StepOptions[] | Step[]

Tour


back(): void

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:200

Go to the previous step in the tour

void


cancel(): Promise<void>

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:211

Calls _done() triggering the ‘cancel’ event If confirmCancel is true, will show a window.confirm before cancelling If confirmCancel is a function, will call it and wait for the return value, and only cancel when the value returned is true

Promise<void>


complete(): void

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:235

Calls _done() triggering the complete event

void


getById(id): Step | undefined

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:244

Gets the step from a given id

The id of the step to retrieve

string | number

Step | undefined

The step corresponding to the id


getCurrentStep(): Step | null | undefined

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:253

Gets the current step

Step | null | undefined


hide(): void

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:260

Hide the current step

void


isActive(): boolean

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:271

Check if the tour is active

boolean


next(): void

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:279

Go to the next step in the tour If we are at the end, call complete

void


off(event, handler?): Tour

Defined in: docs-src/node_modules/shepherd.js/src/evented.ts:53

Removes an event listener for the given event string.

string

AnyHandler

Tour

Evented.off


on(event, handler, ctx?, once?): Tour

Defined in: docs-src/node_modules/shepherd.js/src/evented.ts:22

Adds an event listener for the given event string.

string

AnyHandler

unknown

boolean = false

Tour

Evented.on


once(event, handler, ctx?): Tour

Defined in: docs-src/node_modules/shepherd.js/src/evented.ts:42

Adds an event listener that only fires once for the given event string.

string

AnyHandler

unknown

Tour

Evented.once


removeStep(name): void

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:293

Removes the step from the tour

string

The id for the step to remove

void


setupModal(): void

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:411

setupModal create the modal container and instance

void


show(key?, forward?): void

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:323

Show a specific step in the tour

The key to look up the step by

string | number

boolean = true

True if we are going forward, false if backward

void


start(): Promise<void>

Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:350

Start the tour

Promise<void>


trigger(event, …args): Tour

Defined in: docs-src/node_modules/shepherd.js/src/evented.ts:78

Triggers an event listener for the given event string.

string

any[]

Tour

Evented.trigger