Zephora UI

Overlay

Tour

Guided product tour: a full-screen overlay with a spotlight cut out around the current target element and a positioned tooltip with Back/Next/Skip controls. Steps whose target cannot be found are skipped automatically.

Import

import { Tour } from "@zephora/react";

Examples

Basic tour

Three steps pointing at in-page elements (refs or CSS selectors). Next/Back move through the steps, Skip or Escape ends the tour early.

Search
Compose
Settings

Controlled step

`stepIndex` + `onStepIndexChange` put the active step in your state, so the tour can start at any step and report progress.

Filters
Export

Last viewed step: 1

API

Tour props

PropTypeDefaultDescription
steps *TourStep[]Ordered tour steps. Steps whose target cannot be found are skipped.
openbooleanControlled open state.
defaultOpenbooleanfalseInitial open state (uncontrolled).
onOpenChange(open: boolean) => voidCalled whenever the tour requests an open state change.
stepIndexnumberControlled active step index.
defaultStepIndexnumber0Initial step for uncontrolled usage.
onStepIndexChange(index: number) => voidFires whenever the active step changes.
onFinish() => voidCalled when the user completes the last step.
onSkip() => voidCalled when the user skips out of the tour (Skip button or Escape).
spotlightPaddingnumber8Space between the target and the spotlight cut-out, in px.
scrollIntoViewbooleantrueScrolls the target into view when a step activates.
classNamesPartial<Record<TourSlot, string>>Per-slot class overrides: "overlay" | "spotlight" | "tooltip" | "title" | "content" | "footer" | "button" | "progress". Appended after the module classes and also applied in unstyled mode.
unstyledbooleanfalseHeadless mode — skips Zephora styling.

TourStep props

PropTypeDefaultDescription
target *string | RefObject<HTMLElement | null>CSS selector or ref pointing at the element to highlight.
titleReactNodeOptional step heading.
content *ReactNodeStep body content.
placement"top" | "bottom" | "left" | "right""bottom"Preferred tooltip side (flips when there is no room).

Keyboard

KeyAction
ArrowRightNext step (finishes the tour on the last step).
ArrowLeftPrevious step.
EscapeSkips out of the tour (fires onSkip).
Tab / Shift+TabCycles focus inside the tooltip — focus is trapped while open.