Tour

Onboarding tour that dims the page and cuts a rounded spotlight around each target, gliding and resizing it from step to step, with a card that flips and shifts to stay in the viewport, a gliding progress dot, Back/Next/Skip/Done, targets scrolled into view, Escape to close, trapped focus that returns to the trigger, controlled/uncontrolled open and step, and reduced-motion safe.

Preview

Tour preview width

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/tour
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

API Reference

steps
TourStep[]
—
open?
boolean

Controlled open state.

—
defaultOpen?
boolean

Uncontrolled initial open state.

false
onOpenChange?
((open: boolean) => void)
—
step?
number

Controlled step index.

—
defaultStep?
number

Uncontrolled step the tour (re)starts at each time it opens. Default 0.

0
onStepChange?
((step: number) => void)
—
onComplete?
(() => void)

Fires when Done is pressed on the last step.

—
onClose?
((reason: TourCloseReason) => void)

Fires whenever the tour closes, with why.

—
padding?
number

Space between the target and the spotlight edge, px. Default 8.

8
radius?
number

Spotlight corner radius, px. Default 12.

12
overlayOpacity?
number

Dim strength of the overlay, 0–1. Default 0.6.

0.6
labels?
TourLabels
—
className?
string

Classes for the popover card.

—

Updated