Tour
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:108
Class representing the site tour
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Tour(
options?):Tour
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:119
Parameters
Section titled “Parameters”options?
Section titled “options?”TourOptions = {}
Returns
Section titled “Returns”Tour
Overrides
Section titled “Overrides”Properties
Section titled “Properties”bindings
Section titled “bindings”bindings:
Bindings
Defined in: docs-src/node_modules/shepherd.js/src/evented.ts:11
Inherited from
Section titled “Inherited from”classPrefix
Section titled “classPrefix”classPrefix:
string
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:111
currentStep?
Section titled “currentStep?”
optionalcurrentStep:Step|null
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:112
focusedElBeforeOpen?
Section titled “focusedElBeforeOpen?”
optionalfocusedElBeforeOpen:HTMLElement|null
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:113
optionalid:string
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:114
modal?
Section titled “modal?”
optionalmodal:ShepherdModalAPI|null
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:115
options
Section titled “options”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
Section titled “trackedEvents”trackedEvents:
string[]
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:109
Methods
Section titled “Methods”_setupActiveTour()
Section titled “_setupActiveTour()”_setupActiveTour():
void
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:402
Make this tour “active”
Returns
Section titled “Returns”void
addStep()
Section titled “addStep()”addStep(
options,index?):Step|StepOptions
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:165
Adds a new step to the tour
Parameters
Section titled “Parameters”options
Section titled “options”An object containing step options or a Step instance
index?
Section titled “index?”number
The optional index to insert the step at. If undefined, the step is added to the end of the array.
Returns
Section titled “Returns”The newly added step
addSteps()
Section titled “addSteps()”addSteps(
steps?):Tour
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:187
Add multiple steps to the tour
Parameters
Section titled “Parameters”steps?
Section titled “steps?”The steps to add to the tour
StepOptions[] | Step[]
Returns
Section titled “Returns”Tour
back()
Section titled “back()”back():
void
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:200
Go to the previous step in the tour
Returns
Section titled “Returns”void
cancel()
Section titled “cancel()”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
Returns
Section titled “Returns”Promise<void>
complete()
Section titled “complete()”complete():
void
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:235
Calls _done() triggering the complete event
Returns
Section titled “Returns”void
getById()
Section titled “getById()”getById(
id):Step|undefined
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:244
Gets the step from a given id
Parameters
Section titled “Parameters”The id of the step to retrieve
string | number
Returns
Section titled “Returns”Step | undefined
The step corresponding to the id
getCurrentStep()
Section titled “getCurrentStep()”getCurrentStep():
Step|null|undefined
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:253
Gets the current step
Returns
Section titled “Returns”Step | null | undefined
hide()
Section titled “hide()”hide():
void
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:260
Hide the current step
Returns
Section titled “Returns”void
isActive()
Section titled “isActive()”isActive():
boolean
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:271
Check if the tour is active
Returns
Section titled “Returns”boolean
next()
Section titled “next()”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
Returns
Section titled “Returns”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.
Parameters
Section titled “Parameters”string
handler?
Section titled “handler?”Returns
Section titled “Returns”Tour
Inherited from
Section titled “Inherited from”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.
Parameters
Section titled “Parameters”string
handler
Section titled “handler”unknown
boolean = false
Returns
Section titled “Returns”Tour
Inherited from
Section titled “Inherited from”once()
Section titled “once()”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.
Parameters
Section titled “Parameters”string
handler
Section titled “handler”unknown
Returns
Section titled “Returns”Tour
Inherited from
Section titled “Inherited from”removeStep()
Section titled “removeStep()”removeStep(
name):void
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:293
Removes the step from the tour
Parameters
Section titled “Parameters”string
The id for the step to remove
Returns
Section titled “Returns”void
setupModal()
Section titled “setupModal()”setupModal():
void
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:411
setupModal create the modal container and instance
Returns
Section titled “Returns”void
show()
Section titled “show()”show(
key?,forward?):void
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:323
Show a specific step in the tour
Parameters
Section titled “Parameters”The key to look up the step by
string | number
forward?
Section titled “forward?”boolean = true
True if we are going forward, false if backward
Returns
Section titled “Returns”void
start()
Section titled “start()”start():
Promise<void>
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:350
Start the tour
Returns
Section titled “Returns”Promise<void>
trigger()
Section titled “trigger()”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.
Parameters
Section titled “Parameters”string
…any[]
Returns
Section titled “Returns”Tour