Tour
Guide users through your application with interactive step-by-step tours
Source
LLM docs
Docs
Package
Usage
Tour is a step-by-step guide for application onboarding. It highlights target elements
one by one and displays a tooltip with navigation controls next to each of them.
Tour.Step components must be direct children of Tour.
Complex example
A dashboard onboarding tour: it starts with a centered welcome step, scrolls to targets
inside ScrollArea and changes position and spotlightPadding of individual steps.
John Doe
Admin
Beacon mode
Set mode="beacon" to display pulsing beacons next to all targets instead of a sequential
walkthrough. Users can click beacons in any order to open tooltips. Beacons stay on the page
until active is set to false.
Controlled
Use step and onStepChange props to control the current step. An uncontrolled tour
always starts from defaultStep.
Overlay configuration
withOverlay– display the backdrop overlay,trueby defaultwithOverlayInteraction– allow users to interact with the highlighted element,falseby defaultcloseOnOverlayClick– close the tour when the overlay is clicked,falseby default
Dropdowns rendered in a portal (Select, Menu, etc.) are displayed below the tour.
To use them with withOverlayInteraction, set their zIndex to a value greater than
the tour zIndex, for example comboboxProps={{ zIndex: 10001 }}.
Step targets
target prop of Tour.Step accepts a CSS selector or a ref. Use a selector for elements
that are mounted after the step is activated, a ref must point to an element that is already mounted.
Steps without target
Steps without target are displayed in the center of the screen. Use them for welcome
and completion screens.
Custom content
Tour.Step children can be any React node. To build the tooltip layout yourself,
use compound components. Compound components do not know your steps:
- Pass the total number of steps to
Tour.RootwithstepsCountprop - Find target elements yourself and pass them to
Tour.Overlay(targetRect) andTour.Tooltip(targetElement) - Set a distinct
aria-labelon eachTour.Beacon - To play the exit transition, set
mounted={false}onTour.Tooltipfirst andactive={false}onTour.Rootafter the transition ends
Tooltip position
Set position on Tour.Step to change the tooltip placement. If there is not enough
space, the tooltip flips to the opposite side.
Custom labels
Use labels prop to translate navigation buttons:
Styles API
Keyboard navigation
Arrow keys are ignored while focus is inside the target element or an input.
Set withKeyboardNavigation={false} to disable them.
Accessibility
- The tooltip has
role="dialog", it is labelled by the step title and described by the step body - Focus is moved to the tooltip when it opens and is returned to the previously focused element when the tour closes
- Focus is trapped inside the tooltip while the overlay is displayed
- Step counter changes are announced with
aria-live="polite" - Beacons are buttons labelled with
labels.beaconand the step title, for exampleStart tour: Settings