Controller API
Tour navigation API — currentStep, next, prev, changeStep, finish, and move prevention.
The controller manages the active tour step state. It provides navigation methods, step info, and a move-prevention mechanism for async workflows.
Properties
| Property | Type | Description |
|---|---|---|
isActivated | boolean | true when the tour has at least one step |
currentStep | number | Current 1-based step number |
currentStepIndex | number | Current 0-based index |
totalSteps | number | Total number of steps |
hasNextStep | boolean | true when there is a step after the current one |
hasPrevStep | boolean | true when there is a step before the current one |
currentTarget | HTMLElement | null | Resolved DOM element for the current step's target |
step | BordaStepConfig | undefined | Full data object of the current step, including per-step overrides |
isMovePrevented | boolean | true 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();