Skip to content

GuidedTour

Step-by-step onboarding tour with spotlight highlighting.

Props

GuidedTourProps

PropTypeRequiredDescription
stepsTourStep[]YesTour steps
isOpenbooleanYesWhether tour is active
onClose() => voidYesClose callback
onFinish() => voidYesCompletion callback
classNamestringNoContainer class

TourStep

PropertyTypeRequiredDescription
targetstringYesCSS selector for target element
titlestringYesStep title
contentReactNodeYesStep description
position'top' | 'right' | 'bottom' | 'left'NoTooltip position

Keyboard Navigation

KeyAction
EscapeClose tour
Enter / Next step
Previous step

Example

tsx
const steps: TourStep[] = [
  {
    target: '#sidebar',
    title: 'Navigation',
    content: 'Use the sidebar to navigate.',
    position: 'right',
  },
  {
    target: '#create-btn',
    title: 'Create',
    content: 'Click here to create new items.',
    position: 'bottom',
  },
]

<GuidedTour
  steps={steps}
  isOpen={showTour}
  onClose={() => setShowTour(false)}
  onFinish={handleTourComplete}
/>

See also