# Product tour

Guide people through real interface features with anchored, nonblocking steps.

Access: pro. Category: Feedback. Kind: composite.

## When to use

- Use it when a page needs guide people through real interface features with anchored, nonblocking steps.
- Choose it when the host application can supply the required state and keep business logic outside the presentation component.

## Alternatives

- Choose alert instead when inline notices with icons, actions and optional dismissal is the actual interface need, rather than product tour.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install Product tour

```sh
npx shadcn@latest add @tidal-pro/product-tour
```

Stylesheets: `components/ui/tidal.css`, `components/ui/product-tour.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/product-tour.css";
import{TidalProductTour}from"./components/ui/product-tour";
export default()=><div className="tidal-scope"><TidalProductTour currentId={"example"} onDismiss={() => {}} onFinish={() => {}} onStepChange={() => {}} steps={[{id:"example",title:"Demo",description:"Demo"}]}/></div>;
```

## Structured props

- `TidalProductTour.currentId: string | null`: Required current id value accepted by this exported component.
- `TidalProductTour.onDismiss: (reason: "skip" | "escape" | "dismiss") => void`: Callback invoked when the dismiss interaction is proposed.
- `TidalProductTour.onFinish: () => void`: Callback invoked when the finish interaction is proposed.
- `TidalProductTour.onStepChange: (id: string) => void`: Callback invoked when the step change interaction is proposed.
- `TidalProductTour.steps: ReadonlyArray<TidalTourStep>`: Required steps value accepted by this exported component.
- `TidalProductTour.buttonProps?: ((action: TourAction) => ButtonProps) | undefined`: Optional button props value accepted by this exported component.
- `TidalProductTour.className?: string | undefined` (default ""): Optional class name value accepted by this exported component.
- `TidalProductTour.dir?: "ltr" | "rtl" | undefined` (default "ltr"): Optional dir value accepted by this exported component.
- `TidalProductTour.formatProgress?: ((current: number, total: number) => string) | undefined` (default (n, total) => n + " of " + total): Optional format progress value accepted by this exported component.
- `TidalProductTour.labels?: Partial<{ previous: string; next: string; finish: string; skip: string; missing: string; invalid: string; }> | undefined` (default {}): Optional labels value accepted by this exported component.
- `TidalProductTour.theme?: "light" | "dark" | undefined` (default "light"): Optional theme value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/product-tour.tsx) | [Manifest](https://tidalui.com/examples/product-tour.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
import "./components/ui/tidal.css";

import { useMemo, useRef, useState } from "react";

import { TidalProductTour, type TidalTourStep } from "./components/ui/product-tour";

import "./components/ui/product-tour.css";

import "./components/ui/popover.css";



const tidalExampleStyles = ".product-tour-demo {\n  width: 100%;\n  max-width: 760px;\n  border: 1px solid var(--t-border);\n  border-radius: 20px;\n  background: var(--t-surface);\n  padding: 24px;\n  color: var(--t-ink);\n}\n.product-tour-demo header {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 20px;\n}\n.product-tour-demo button {\n  min-height: 44px;\n  padding: 10px 14px;\n  border: 1px solid var(--t-border);\n  border-radius: 8px;\n  background: var(--t-surface);\n  color: var(--t-ink);\n  font: inherit;\n  font-size: 12px;\n  cursor: pointer;\n}\n.product-tour-demo nav {\n  display: flex;\n  gap: 8px;\n  margin: 24px 0;\n}\n.product-tour-demo nav button[aria-pressed=\"true\"] {\n  background: var(--t-subtle);\n}\n.product-tour-demo-activity {\n  padding: 20px;\n  margin-bottom: 20px;\n  background: var(--t-subtle);\n  border-radius: 12px;\n}\n.product-tour-demo small {\n  font-size: 11px;\n  text-transform: uppercase;\n  letter-spacing: 0.1em;\n  color: var(--t-muted);\n}\n.product-tour-demo h3 {\n  font-size: 19px;\n  margin: 10px 0;\n}\n.product-tour-demo p {\n  font-size: 12px;\n  line-height: 1.6;\n  color: var(--t-muted);\n}\n@media (max-width: 400px) {\n  .product-tour-demo {\n    padding: 16px;\n  }\n  .product-tour-demo header {\n    flex-wrap: wrap;\n    gap: 10px;\n  }\n}";

export function ProductTourDemo({
  theme = "light",
}: {
  theme?: "light" | "dark";
}) {
  const [current, setCurrent] = useState<string | null>(null),
    [done, setDone] = useState(false),
    [tab, setTab] = useState("Overview");
  const projects = useRef<HTMLButtonElement>(null),
    activity = useRef<HTMLDivElement>(null),
    create = useRef<HTMLButtonElement>(null);
  const steps = useMemo<readonly TidalTourStep[]>(
    () => [
      {
        id: "projects",
        title: "Find your projects",
        description: "Keep active work close. This tab opens the project list.",
        target: () => projects.current,
      },
      {
        id: "activity",
        title: "Review recent activity",
        description: "See the latest changes in this workspace.",
        target: () => activity.current,
      },
      {
        id: "create",
        title: "Start something new",
        description: "Create a project when you are ready.",
        target: () => create.current,
      },
    ],
    [],
  );
  return (
    <div className="product-tour-demo">
      <header>
        <strong>Workspace</strong>
        <button
          onClick={() => {
            setDone(false);
            setCurrent("projects");
          }}
        >
          Take a tour
        </button>
      </header>
      <nav>
        {["Overview", "Projects"].map((label) => (
          <button
            key={label}
            ref={label === "Projects" ? projects : undefined}
            aria-pressed={tab === label}
            onClick={() => setTab(label)}
          >
            {label}
          </button>
        ))}
      </nav>
      <div ref={activity} className="product-tour-demo-activity">
        <small>{tab}</small>
        <h3>{tab === "Projects" ? "Your projects" : "Recent activity"}</h3>
        <p>
          {tab === "Projects"
            ? "Website refresh · Review"
            : "Website refresh moved to review."}
        </p>
      </div>
      <button ref={create} onClick={() => setTab("Projects")}>
        Create project
      </button>
      {done && <p role="status">Tour complete in this preview.</p>}
      <TidalProductTour
        theme={theme}
        steps={steps}
        currentId={current}
        onStepChange={setCurrent}
        onDismiss={() => setCurrent(null)}
        onFinish={() => {
          setCurrent(null);
          setDone(true);
        }}
      />
    </div>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <ProductTourDemo />
    </div>
  );
}

```

## Gotchas

- Install the declared registry dependencies and render inside a tidal-scope with the foundation stylesheet loaded.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"keyboard":["Tab and Shift+Tab follow the component's native focus order.","Arrow-key behavior follows the exported composite-control implementation.","Escape dismisses the open overlay where the underlying primitive supports dismissal."],"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"Verify focus visibility, text alternatives, contrast, and reduced motion in the final composition."}

Controlled currentId or null and up to40 unique nonblank step IDs, titles and descriptions. Each step may return a real HTMLElement through target(), provide body content and a preferred side. The accepted Popover provides nonmodal focus and collision positioning. A noninteractive outline marks the visible target; missing or offscreen targets show an explicit fallback. Resize, scroll and target removal update positions, without automatic document scrolling. Outside controls stay interactive while the tour stays open. Native Back/Next/Finish/Skip actions preserve caller-first events and disabled props. Escape and finish call the supplied callbacks; no step or completion is persisted. Opening focuses the step heading, accepted steps advance focus only from inside the tour/body, and closing restores the original opener only while the popup/body still owns focus. Phone layouts place the same dialog as a bottom panel. Theme/direction, translated controls, progress formatter, native content ref and reduced motion are supported.
