0.2.0

The controller manages the active tour step state. It provides navigation methods, step info, and a move-prevention mechanism for async workflows.

Properties

PropertyTypeDescription
isActivatedbooleantrue when the tour has at least one step
currentStepnumberCurrent 1-based step number
currentStepIndexnumberCurrent 0-based index
totalStepsnumberTotal number of steps
hasNextStepbooleantrue when there is a step after the current one
hasPrevStepbooleantrue when there is a step before the current one
currentTargetHTMLElement | nullResolved DOM element for the current step's target
stepBordaStepConfig | undefinedFull data object of the current step, including per-step overrides
isMovePreventedbooleantrue while navigation is paused via preventMove()

Methods

next()

Navigate to the next step. On the last step, calls finish() instead:

await instance.api.controller.next();

prev()

Navigate to the previous step:

await instance.api.controller.prev();

changeStep(index)

Jump to a specific step by 0-based index. Waits for prepareElement if defined:

await instance.api.controller.changeStep(2); // jump to step 3

finish()

Emit ON_TOUR_FINISH and end the tour:

instance.api.controller.finish();

preventMove()

Pause the in-progress navigation. Useful for async workflows where you need to fetch data or animate something before the step changes:

instance.api.events.on(BordaEvent.ON_TOUR_STEP_CHANGE, async () => {
  instance.api.controller.preventMove();
  await loadData();
  instance.api.controller.continue();
});

continue()

Resume a navigation paused by preventMove():

instance.api.controller.continue();

clearMovePrevented()

Cancel a paused navigation without completing it:

instance.api.controller.clearMovePrevented();