Shows a short guide that points at parts of the page, one step at a time.
The CLI adds the files, packages, theme variables, and Tailwind plugin that this component uses. Before you run it, set up your project.
TourOwns the open state and the step. Renders the popover for you.
TourTargetRepeatsWrap the element each step points at. The id matches the step id.
useTour Returns isOpen, step, count, start, stop, next, and previous for a button inside the tour.
Set spotlight to false to keep the page usable. Also install Button and Checkbox.
Also install Button and Stepper.
- One inbox
- Save a view
- A daily digest
Start the tour in an effect and save completion in onComplete. Also install Button.
First visit.
vip/ui adds or changes the props below. For all other props, see React Aria Popover (opens in a new tab).
Tour
Owns the open state and the step. Renders one non-modal popover and one spotlight.
- steps: readonly TourStep[]Required
- Sets the guide. Each step needs an `id` that matches a `TourTarget`, a title, and a description.
- isOpen: boolean
- Controls the tour.
- defaultOpen: boolean = false
- Opens the tour at first, at `defaultStep`.
- onOpenChange: (isOpen: boolean) => void
- Receives requests to open or close the tour.
- step: number
- Sets the current step, counted from zero.
- defaultStep: number = 0
- Sets the step that opens first.
- onStepChange: (step: number) => void
- Receives each step change from Next, Back, or `start`. A step without a mounted target is skipped in the direction of travel.
- onComplete: () => void
- Runs when Done is pressed on the last reachable step. The consumer saves progress here.
- onSkip: () => void
- Runs on Skip tour and on Escape.
- spotlight: boolean = true
- Dims the page except for the target and blocks clicks outside it. Set it to `false` to keep the page usable.
TourTarget
Wraps the element that a step points at. Its first element child is the target. The id matches the step id.
- id: stringRequired
- Matches the `id` of the step that points here.