Spotlight / Feature Discovery

Guide users through your interface with step-by-step tours. An overlay highlights target elements while a tooltip provides context and navigation controls. Add a JSON array of steps to any trigger via data-vd-spotlight and it starts on click.

Interactive Tour

Click the button below to start a 3-step feature discovery tour that highlights the elements in this card.

Notifications

Profile Menu

Engine wiring
API Reference

CSS Classes

ClassDescription
.vd-spotlight-overlayFull-screen click catcher; dimming comes from the highlight cutout.
.vd-spotlight-highlightBody-level cutout positioned over the active target (box-shadow dimmer).
.vd-spotlight-tooltipFloating step tooltip positioned beside the target.
.vd-spotlight-titleTooltip heading (the step's title).
.vd-spotlight-descriptionTooltip body copy (the step's description).
.vd-spotlight-counter“2 / 3” progress indicator.
.vd-spotlight-footerFooter row holding the navigation buttons.
.vd-spotlight-btnSecondary navigation button (Back / Skip).
.vd-spotlight-btn-primaryPrimary navigation button (Next / Done).
.vd-spotlight-targetClass applied to the highlighted element while active.

Data Attributes

AttributeDescription
data-vd-spotlightJSON array of steps on the trigger. Each step: { target, title, description }.

JavaScript Methods

MethodDescription
useSpotlight(root, options?)Wire every [data-vd-spotlight] trigger within root; returns a SpotlightApi controller. Call once in setup().
UseSpotlightOptions{ tooltipGap?: number (12), viewportMargin?: number (8), settleFrames?: number (30), labels?: { back?, skip?, next?, done? } }.
controller.start(steps, opts?)Start a tour from an array of SpotlightStep objects ({ target, title?, description?, content? }). Optional { trigger } restores focus on stop.
controller.stop()End the active tour, remove the overlay/cutout, and restore focus to the trigger.
controller.next() / controller.prev()Advance to the next step or return to the previous step of the active tour.
controller.refresh()Re-scan root and wire [data-vd-spotlight] triggers added after mount.
spotlight:stepCustomEvent<{ index, step, total, data }> dispatched on document whenever a step is shown.
spotlight:endCustomEvent<{ completedSteps, total, completed }> dispatched on document when the tour ends.
Accessibility
  • The step tooltip renders with role="dialog", aria-modal="true", and wires the step title and description via aria-labelledby and aria-describedby.
  • Pressing Escape (or clicking the overlay / Skip / Done buttons) closes the tour and restores focus to the trigger element that launched it.
  • The active target receives .vd-spotlight-target and is scrolled smoothly into view while the body-level cutout (aria-hidden="true") tracks its bounding box.