Skip to content

Tour

Step-by-step feature onboarding with a fullscreen overlay and target highlighting. Supports 12-direction placement with overflow flipping, scroll-following repositioning, mask/form customization, keyboard navigation, async steps, hints beacons and a "Don't show again" memory.

Basic usage

Start the tour

Start tour
Highlighted area 1
Highlighted area 2

Tour events

oas-step carries detail: { index, current, total, next, prev }; closing events (cancel/finish/close/skip/destroy) carry detail: { index, total }.

Step events

Start tourNot started
Highlighted area 1
Highlighted area 2

Controlled step and visibility

Both open and current are controlled attributes: an external button / JS sets open to start the tour, and sets current to jump directly to a given step (no need to click through).

Controlled open / current

Start tour (set open)Jump to step 2 (current=1)Jump to step 3 (current=2)Finish (remove open)
Controlled highlight area 1
Controlled highlight area 2
Controlled highlight area 3

Placement and arrow

placement supports 12 directions (top/bottom/left/right × start/end/center) plus center; it auto-flips along the main axis when space is insufficient. arrow="false" hides the arrow.

12 directions and auto-flip

Right placement (placement=right)Auto-flip at bottomNo arrow (arrow=false)
Right placement target
Multi-direction target
Bottom target (viewport edge)

Scroll to target and repositioning

When the target is off-screen the tour scrolls to it (scroll-into-view-options is passed through; scroll-padding sets the target's scroll-margin). During the tour the highlight and popup follow scroll/resize automatically (auto-reposition, enabled by default).

Scroll to target and scroll-follow

Start tour (target below the fold)
Below-the-fold target 1 (scrolled to)
Below-the-fold target 2

Overlay and form

mask="false" disables the overlay (non-modal; the rest of the page stays interactive during the tour); mask='{"color":"..."}' customizes the overlay color; type="primary" uses a primary-colored popup for emphasis; gap controls the highlight padding and radius (a number or {padding, radius}).

Non-modal + primary popup

Non-modal + primary popupCustom overlay color
Non-modal highlight 1
Non-modal highlight 2

Keyboard navigation and indicators

keyboard (enabled by default) advances steps with ←/→; show-bullets renders clickable dot indicators; show-progress shows a top progress bar; progress-text is a template (/) for custom counter text; indicators="number" shows a numeric counter.

Keyboard + dots + progress bar

Start tour (keyboard + dots + progress)Disable keyboard navigation
Keyboard target 1
Keyboard target 2
Keyboard target 3

Button visibility and pass-through props

hide-prev / hide-skip / hide-next / hide-counter control button/counter visibility; *-button-props (next/prev/skip/finish) pass arbitrary attributes to the buttons (JSON object).

Button visibility and props

Visibility + propsHide all actions
Button customization target 1
Button customization target 2

Close button customization

show-close="false" hides the close button; close-icon replaces its content with arbitrary HTML.

Close button customization

Custom close iconNo close button
Close button target

Overlay click and highlight interaction

mask-click-behavior: close (default) / next (advance on overlay click) / none (ignore); target-area-clickable makes the highlight area interactive (clicks pass through); disabled-interaction blocks interaction with the highlighted area; advance-on-click advances when the highlight area is clicked ("try it here" interactive tours).

Overlay click behavior + highlight interaction

Overlay click advancesOverlay click ignoredHighlight interactiveHighlight blockedClick highlight to advance
Highlight interaction target 1
Highlight interaction target 2

Async steps

wait-for-element (ms) waits for the target to appear (e.g. "the previous step opened a dialog, wait for its inner element to render"); skip-missing-element skips the step when the target is missing / the wait times out.

Wait for async targets and skip

Wait for async targetSkip missing target
Regular target

Dialog mode

mode="dialog" (or step-level mode: "dialog") renders a centered dialog step without a target as a first-class step type.

Dialog mode

Start tour

Lifecycle events

oas-highlight-start / oas-highlight-end fire when the step highlight starts/completes (after async waits resolve); oas-destroy fires when the tour closes (including external removal of open).

Lifecycle events

Start tourNo events yet
Lifecycle target 1
Lifecycle target 2

Don't show again and multi-page tours

With dont-show-again, checking "Don't show this again" on close remembers the choice via storage-key; the next start is blocked and oas-dismiss fires. persist persists open/current state so a remount after route changes resumes the tour (multi-page tours).

Don't show again

Open tour (blocked once remembered)Clear memory
Memory target

Multi-page tour (persist)

Start tourSimulate route change (remount)
Multi-page target 1
Multi-page target 2

Typewriter and scroll lock

typewriter + typewriter-speed reveal the description character by character; lock-scroll locks page scrolling during the tour; close-on-press-escape="false" disables Esc.

Typewriter animation + scroll lock

Start tour
Typewriter target 1 (with cover image)
Typewriter target 2

Hints beacon mode

hints renders persistent pulsing beacons (no open needed); clicking a beacon opens a bubble. Hints with dismissable + id are remembered in localStorage (oas-tour-hint-${id}) and hidden afterwards.

Hints beacon mode

Beacon target 1 (dismissable)
Beacon target 2 (persistent)

Mount point and z-index

append-to="body" (or a selector) mounts the whole overlay into the given container; z-index customizes the stacking level.

Mount point and z-index

append-to body + high z-index
Mount target

API

Attributes

AttributeDescriptionTypeDefault
advance-on-clickClick the highlighted area to advance to the next step (interactive tour)boolean
append-toMount point: body or a CSS selector (moves the whole overlay into the target container)string
arrowWhether to show the arrow (boolean, default true; false hides)stringtrue
auto-repositionAuto reposition on scroll/resize (default true)stringtrue
close-iconCustom close button content (HTML string)string
close-on-press-escapeClose on Esc (default true)stringtrue
currentCurrent step indexstring0
disabled-interactionDisable interaction on the highlighted area (interceptor covers target)
dont-show-againDon't show again switch (boolean; if checked on close, remembered in localStorage)boolean
finish-button-propsProps passed through to the finish button (JSON object)
gapHighlight padding: number (padding px) or {"padding","radius"}; default padding 4string
hide-counterHide the step counterboolean
hide-nextHide the next button
hide-prevHide the previous button
hide-skipHide the skip button
hintsHints beacon mode: JSON [{id,selector,title,description,placement,dismissable}]; persistent pulsing beacons, click to open a bubble, dismissable is remembered after closestring[]
indicatorsCounter style: dots (default) / number / nonestringdots
keyboardKeyboard ←/→ to advance steps (default true; false disables)stringtrue
lock-scrollLock page scrolling during the tour (restored on close)boolean
maskOverlay switch/customization: false to disable (non-modal) or {"color","style"} to customize (default true); step-level overridestringtrue
mask-click-behaviorOverlay click behavior: close (default) / next (advance) / none (ignore)stringclose
modePopup mode: popup (default) / dialog (centered dialog without target); step-level overridestringpopup
next-button-propsProps passed through to the next button (JSON object, e.g. {"data-x":"1"})
openStart the tour (boolean attribute; starts when present)boolean
persistMulti-page tour: open/current state persisted to localStorage and restored on reconnectboolean
placementPopup placement: 12 directions (top/bottom/left/right × start/end/center) + center (centered when no target); default bottom; auto-flips when space is insufficient; step-level overrideTourPlacementbottom
prev-button-propsProps passed through to the previous button (JSON object)
progress-textProgress text template: / replacement; when set, the counter area uses the templatestring
scroll-into-view-optionsscrollIntoView options for scrolling to the target (JSON; default {"behavior":"smooth","block":"center"})string
scroll-paddingPadding when scrolling to the target (px; applied as target scroll-margin)
show-bulletsDot indicators (click a dot to jump)boolean
show-closeShow the close button (default true; false hides)stringtrue
show-progressProgress bar at the top of the popup (width advances with steps)boolean
skip-button-propsProps passed through to the skip button (JSON object)
skip-missing-elementSkip the step when the target is missing / wait times out (default stays on the current step)boolean
stepsSteps JSON (TourStep[] | string); property assignment supports function/element targetsTourStep[] | string[]
storage-keylocalStorage key (shared by dont-show-again / persist / hint dismiss)stringoas-tour-dismiss
target-area-clickableHighlight area is interactive (interceptor hidden, clicks pass through to target)stringfalse
typePopup type: default / primary (primary-colored popup for non-modal emphasis)stringdefault
typewriterTypewriter animation: description revealed character by characterstringfalse
typewriter-speedTypewriter speed (ms per character, default 20)string20
wait-for-elementWait for the target to appear (ms, async steps; global default, step-level waitForElement wins)
z-indexOverlay z-index (default --oas-z-modal)

Events

EventDescription
oas-cancelSkipped / Esc / overlay click, detail: { index, total, source } (source: skip/esc/close/mask)
oas-closeClose button clicked, detail: { index, total }
oas-destroyTour closed (including external removal of open), detail: { index, total }
oas-dismissDon't show again matched; tour start was blocked, detail: {}
oas-finishFinish was clicked on the last step, detail: { index, total }
oas-highlight-endStep highlight completed, detail: { index, total }
oas-highlight-startStep highlight started (after async wait resolves), detail: { index, total }
oas-skipSkip button clicked, detail: { index, total }
oas-stepStep changed, detail: { index, current, total, next, prev }

Slots

NameDescription
coverStep cover rich content (slot takes precedence over the step.cover image)

The overlay highlights the target, role="dialog" + aria-modal="true"; supports "Previous / Next / Skip", keyboard ←/→ and Esc.

Released under the MIT OR Apache-2.0 License.