Skip to content

Steps

Only target and some content really matter on their own. Everything else has a working default.

FieldTypeWhat it does
idstringStable handle for goTo('id'), deep links and analytics.
targetstring | Element | fnCSS selector, element, or a function that returns one. Leave it off (or pass null) for a centred step.
titlestringHeading. Becomes part of the card’s accessible name.
textstringBody copy, inserted as text. Never parsed as HTML.
htmlstring | HTMLElementEscape hatch for markup. Sanitising is on you.
placementPlacementSee Placement. Falls back to the tour’s.
fallbackPlacementsPlacement[]Placements to try in order when your first pick doesn’t fit (JS strategy).
offsetnumberGap between target and card, in px. Default 12.
paddingnumberBreathing room around the spotlight cutout. Default 6.
radiusnumberSpotlight corner radius. Defaults to whatever the target already has.
interactivebooleanKeep this target clickable. Overrides the tour setting.
buttonsStepButton[]Replaces the default row. See Buttons.
scrollTobooleanDefault true, but it only scrolls if the target is actually clipped.
waitFornumber | fnMilliseconds to wait for the target, or a predicate to await. Default 0, so no waiting.
advanceOn{ selector?, event, when? }Move on when the user performs the real action.
beforeShow(tour) => void | PromiseRuns before the step renders. Await it to stall.
afterHide(tour) => void | PromiseRuns after the step is torn down.
focus'card' | 'target' | 'none'Where focus lands. Default card.
when() => booleanReturn false and the step gets skipped entirely.
classesstringExtra class names on the card, for per-step styling.

StepButton

FieldTypeWhat it does
labelstringVisible label.
action'next' | 'back' | 'cancel' | 'complete' | ((tour) => void)Built-in action, or your own handler.
classesstringExtra class names for styling hooks.
variant'primary' | 'secondary' | 'ghost'Visual weight. Defaults to secondary for back, primary for next.
disabledbooleanGets aria-disabled and not the real disabled attribute, so it stays focusable.

AdvanceOn

FieldTypeWhat it does
selectorstringElement to listen on. Defaults to the step’s target.
eventstringDOM event name, e.g. click, input, submit.
when(event) => booleanOnly advance when this returns true.