Skip to main content

sp-walkthrough

Interactive video walkthrough component that overlays timed scenes on a video. Each scene can highlight a DOM element, display a caption, and auto-advance on a timeline. Includes author mode for creating walkthroughs by pointing and clicking elements on the page.

Preview Limitation

Walkthrough examples below use a text-only mode (no video source) to demonstrate scene-based navigation. Full video playback requires an MP4 source and does not work inside documentation iframes. The component's full functionality — video sync, DOM highlighting, and captions — is available when used in a real application.

Installation

Install from a GitHub Release:

npm install https://github.com/StephanWald/trm-ai-webcomponents/releases/download/v0.0.1/skillspilot-webcomponents-0.0.1.tgz

Or load via script tag:

<script type="module" src="https://stephanwald.github.io/trm-ai-webcomponents/wc/skillspilot.esm.js"></script>

Examples

Basic Walkthrough (Manual Navigation)

A walkthrough with no video — scenes advance manually via the Next/Prev buttons. Useful for UI tours without a recorded video.

View / Edit Source

Author Mode

Enable author mode with author-mode="true" to create new scenes by clicking DOM elements. The component activates a pointer tool and records element selectors into the scene timeline.

View / Edit Source

Event Handling

Listen to walkthrough-shown, walkthrough-hidden, scene-changed, and timeline-updated events to integrate the walkthrough into your application state.

View / Edit Source

Programmatic Control

Use the component's methods (show(), hide(), play(), pause(), restart(), abort()) to control the walkthrough from your application code.

View / Edit Source

API Reference

Properties

PropertyAttributeTypeDefaultDescription
authorModeauthor-modebooleanfalseAuthor mode - enables scene editing and pointer tool
autoPlayauto-playbooleanfalseAuto-play video on show
captionsSrccaptions-srcstringWebVTT captions file URL
scenesScene[][]Array of walkthrough scenes
themetheme"auto" | "dark" | "light"'auto'Theme override
videoSrcvideo-srcstringVideo source URL (MP4/WebM/YouTube) - optional for manual-only mode

Events

EventDetail TypeDescription
sceneChangedSceneChangeDetailEmitted when scene changes
timelineUpdatedTimelineUpdateDetailEmitted when timeline is updated (author mode)
walkthroughAbortedvoidEmitted when walkthrough is aborted (ESC key or abort method)
walkthroughHiddenvoidEmitted when walkthrough is hidden
walkthroughShownvoidEmitted when walkthrough is shown

Methods

MethodSignatureDescription
abort() => Promise<void>Abort walkthrough (cleans up and hides)
hide() => Promise<void>Hide the walkthrough
pause() => Promise<void>Pause video
play() => Promise<void>Play video
restart() => Promise<void>Restart walkthrough from beginning
show() => Promise<void>Show the walkthrough

CSS Custom Properties

PropertyDescription
--dwc-border-radiusDefault border radius for buttons, inputs, and control elements
--dwc-border-radius-lgLarge border radius for the walkthrough panel corners
--dwc-color-borderBorder color for the panel, control buttons, and scene selector
--dwc-color-border-hoverBorder hover color for control buttons
--dwc-color-dangerDanger color for scene delete button text
--dwc-color-danger-bgDanger background on scene delete button hover
--dwc-color-info-bgInfo background for scene editor panel
--dwc-color-info-borderInfo border for scene editor panel
--dwc-color-primaryPrimary brand color for controls row background, focus rings
--dwc-color-primary-darkDarker primary shade for author button hover
--dwc-color-primary-textText color on primary-colored surfaces (controls row)
--dwc-color-successSuccess color for the active pointer-tool button indicator
--dwc-color-surfaceBackground color for the walkthrough panel and form inputs
--dwc-color-surface-secondarySecondary surface color for control buttons and scene list items
--dwc-color-textPrimary text color for scene titles, control buttons, and form labels
--dwc-color-text-secondarySecondary text color for scene descriptions and counter
--dwc-color-warningWarning color for selector instability indicators
--dwc-color-warning-bgWarning background for author toolbar
--dwc-color-warning-borderWarning border for author toolbar
--dwc-font-familyBase font family for all panel text
--dwc-font-size-baseBase font size for scene titles and controls
--dwc-font-size-smSmall font size for scene descriptions, counter, and author UI
--dwc-font-size-xsExtra-small font size for metadata labels and form help text
--dwc-font-weight-semiboldSemibold weight for panel title, scene titles, and form labels
--dwc-line-height-normalNormal line height for scene description text
--dwc-shadow-xlExtra-large shadow for the floating walkthrough panel
--dwc-spacing-mdMedium spacing for panel content padding and section margins
--dwc-spacing-smSmall spacing for control bar gaps
--dwc-spacing-xsExtra-small spacing for tight gaps in controls
--dwc-transition-baseBase transition duration for panel show/hide animation
--dwc-transition-fastFast transition duration for button hover states
--dwc-z-modalZ-index for the walkthrough panel to float above page content