Skip to content
English
Product tour comes with Pro. Its preview shows once you unlock it.

How it works

The spotlight is one element: its 9999px spread shadow dims the screen, and transform, width, height and radius animate together so it glides and resizes between targets on one curve. The card is placed below the target, else above, else at the bottom of the frame, clamped inside, with its arrow pointing at the target's centre. Positions are measured in layout pixels and remeasured when the frame resizes.

Use it for

  • A first visit to a dense screen, pointing out three to five key places.
  • Introducing a new feature in an existing layout.

Look elsewhere when

  • Explaining things the interface should make obvious: fix the interface instead.
  • Long tutorials: link to a guide.

Usage

import { useState } from 'react'
import { ProductTour } from './ProductTour.jsx'

export function Onboarding() {
  const [open, setOpen] = useState(true)
  return (
    <ProductTour
      open={open}
      onOpenChange={setOpen}
      steps={[
        { target: '[data-tour="new"]', title: 'Start a project', body: 'Create one per client or campaign.' },
        { target: '[data-tour="search"]', title: 'Find anything', body: 'Projects, files and people in one box.' },
      ]}
    />
  )
}

Props

PropTypeDefaultWhat it does
steps{ target: string | RefObject, title, body }[]—Steps in order. A string target is a CSS selector looked up inside the tour's parent element.
open / onOpenChangeboolean / (open) => voidopen trueShown or not; closes on Skip, Done, Escape or a click on the dimmed area.
step / defaultStep / onStepChangenumberdefaultStep 0The current step, controlled or not.
labelsobject—Replaces next, back, done, skip and progress (with {n} and {total}).
paddingnumber8Space between the target and the spotlight edge, in px.
containedbooleanfalseCover the parent element instead of the viewport.

Accessibility

  • The card is a modal role dialog labelled by the step title and described by its text; the step count is a polite live region.
  • Moving to a step focuses the Next or Done button; Tab cycles inside the card; Left and Right change steps; Escape closes.
  • The spotlight and dimming are aria-hidden decoration; all meaning is in the card text.
  • Buttons are 32px high with visible focus rings.
  • With reduced motion the spotlight and card jump between targets and the pulse is off.

Motion

Spotlight and card 520ms cubic-bezier(0.65, 0, 0.25, 1); step text rises 4px in 360ms; two soft pulses around each new target; progress dot stretches to 18px.

Add it to your project

Pro members copy a prompt and their coding agent installs the source, the same way as the free components.

ProductTour.jsxproduct-tour.csstokens.cssREADME.md

Both files install together. The stylesheet reads the design tokens in tokens.css and carries fallbacks, so it also works alone.

Overlays
Bottom sheet comes with Pro. Its preview shows once you unlock it.