A sequential coach-mark system that spotlights UI elements one at a time with a tooltip overlay, dimmed backdrop, and navigation controls. Used for feature onboarding, product tours, and contextual help. Supports dismiss, skip-all, and persistence of completion state via callbacks.
Introduction
Overview
Product tours and feature spotlights are a standard onboarding pattern for SaaS applications. This widget provides a step-by-step coach-mark system that highlights target elements, displays contextual tooltips, and tracks completion state through consumer-provided callbacks.
Goals
Sequential spotlight steps targeting DOM elements by ref or CSS selector.
Tooltip with title, body, step counter, and navigation (back/next/skip/done).
Dimmed backdrop with a cutout around the spotlighted element.
Scroll-into-view for off-screen targets.
Persistence of completion/dismissal via onComplete and onDismiss callbacks.
Adds complexity; can filter steps array externally
Inline/embedded mode
Focus on overlay spotlight; inline tips are a separate pattern
Users and Pain Points
User
Pain Point
Product managers
No reusable onboarding tour component; teams build ad-hoc solutions
Developers
Positioning logic and backdrop cutouts are error-prone to implement
End users
Missing contextual guidance for new features
Definitions
Term
Definition
Coach mark
A UI overlay that highlights a specific element with explanatory content
Spotlight
The visual cutout in the backdrop that draws attention to the target
Tour
A sequence of spotlight steps presented in order
Persistence
Remembering that a user has completed or dismissed a tour
Current State
No spotlight or coach-mark component exists in the design system. The Tooltip primitive exists for hover tooltips but does not support sequential tours, backdrops, or step navigation.
Proposed Solution
Create a FeatureSpotlight widget at src/components/widgets/feature-spotlight.tsx that:
Accepts an array of SpotlightStep objects defining targets, content, and placement.
Renders a full-viewport backdrop with a CSS/SVG cutout around the current target.
Positions a tooltip adjacent to the cutout using Floating UI (or manual calculation).
Provides Back, Next, Skip All, and Done navigation.
Scrolls off-screen targets into view before showing the spotlight.
Fires onStepChange, onComplete, and onDismiss callbacks for consumer instrumentation and persistence.
Requirements
The spotlight must handle dynamic layouts (targets may move on resize), clean up on unmount, and not interfere with the target element’s interactivity when the spotlight is active.
Functional Requirements
ID
Requirement
Priority
FR-01
Render a semi-transparent backdrop with a cutout around the target element
Must
FR-02
Display a tooltip with title, body text, and step counter (e.g., “2 of 5”)
Must
FR-03
Position tooltip relative to target using configurable placement (top/bottom/left/right)
Must
FR-04
Provide Next and Back navigation buttons
Must
FR-05
Provide a Skip All button to dismiss the entire tour
Must
FR-06
Show a Done button on the final step
Must
FR-07
Scroll the target element into view when it is off-screen
Must
FR-08
Call onStepChange(stepIndex) when the active step changes
Must
FR-09
Call onComplete() when the user finishes the tour
Must
FR-10
Call onDismiss(stepIndex) when the user skips or closes the tour
Must
FR-11
Update cutout position on window resize and scroll
Should
FR-12
Allow the target element to remain interactive (clickable) during spotlight
Should
Non-Functional Requirements
ID
Requirement
NFR-01
Backdrop renders without causing layout reflow
NFR-02
Cutout repositions within 100 ms of resize/scroll events
NFR-03
Full light/dark theme support for the tooltip
NFR-04
Bundle size under 4 KB gzipped
API / Interface Requirements
interface SpotlightStep {
target:string|React.RefObject<HTMLElement>; // CSS selector or ref