Tour

A product tour. A spotlight glides from one element to the next, stretching on springs, with a card beside it. Overlays.

Open playground
Inbox
Reports
Settings

About

Tour is a React component in the Overlays category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { Tour } from "@ashutoshswamy/smoui" and set steps, trigger, open.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { Tour } from "@ashutoshswamy/smoui";

<Tour
  trigger="Start tour"
  steps={[
    { target: "#inbox", title: "Your inbox", body: "New messages land here first." },
    { target: "#reports", title: "Reports" },
  ]}
  onFinish={() => markSeen()}
/>

Props 3

steps

`target` is a CSS selector. Each element is scrolled into view.

{ target: string; title: string; body?: string }[]
trigger / triggerClassName

Start button. Omit and use `open`.

ReactNode / string
open / onOpenChange / onFinish

Controlled mode and a callback for the last step.

boolean / fn / fn