Type to search Tours, Hints, options, and events.

to navigate · Enter to open · Esc to close

Documentation

Tour

Every Tour option, method, and component prop, with its default.

A Tour is a Driver.js walkthrough plus the two things UX Driver adds on top: a stable id and the once flag. Every option below can be set in all three authoring forms.

Create

Component

<twig:Driver:Tour id="onboarding">
    ...
</twig:Driver:Tour>

Twig builder

{% set tour = create_tour('onboarding') %}

PHP builder

$tour = $tourBuilder->create('onboarding');

TourBuilder is an autowired service — type-hint it in a controller and Symfony injects it. The id is required, and it is the key once persists under.

Options

Builder methods carry the same name as the component prop. Bundle marks options UX Driver adds; everything else is passed through to Driver.js.

Option or methodTypeDefault
showProgress / showProgress()boolbundle true; Driver.js default false
animate / animate()booltrue
smoothScroll / smoothScroll()boolfalse
allowClose / allowClose()booltrue
allowScroll / allowScroll()boolfalse
allowKeyboardControl / allowKeyboardControl()booltrue
disableActiveInteraction / disableActiveInteraction()boolfalse
duration / duration()int ms500
overlayColor / overlayColor()string#000
overlayOpacity / overlayOpacity()float0.7
overlayClickBehavior / overlayClickBehavior()close or nextStepclose
stagePadding / stagePadding()int10
stageRadius / stageRadius()int5
popoverClass / popoverClass()stringnone
popoverOffset / popoverOffset()int10
showButtons / showButtons()list of next, previous, closeall
disableButtons / disableButtons()list of next, previous, closenone
progressText / progressText()string or trusted markup{{current}} of {{total}}
nextBtnText / nextBtnText()string or trusted markupNext →
prevBtnText / prevBtnText()string or trusted markup← Previous
doneBtnText / doneBtnText()string or trusted markupDone
once / once() Bundleboolfalse
autostart Bundleboolfalse; component prop only

The four text options are escaped before serialization — see Security — and a Step can override any of them for itself (Step reference).

Methods

MethodReturns
addStep()$this, with the Step appended
getSteps()Serialized Driver.js steps
getOptions()Serialized Driver.js config
isOnce()The bundle persistence flag

Twig functions

FunctionRenders
create_tour(id)A new Tour, for chaining in a template
ux_tour(tour)Controller attributes, always with autostart=false
ux_tour_action(action, params)data-action (and params) for the Tour controller
ux_highlight(element, title, description, side, align, options)A one-Step Tour for the highlight action
ux_driver_html(html)A string marked as trusted markup

ux_highlight() has its own page: Highlights.

PHP services

ServiceReturns
Pentiminax\UX\Driver\Builder\TourBuilder::create(id)A new Tour, for chaining in PHP
Pentiminax\UX\Driver\Builder\HintsBuilder::create(id)A new Hints

Both are autowired, so a controller or a service only has to type-hint them. create_tour() and create_hints() are thin Twig wrappers over exactly these two calls.