Overlays & confirmation
useTour
The step and group navigation behind Tour, as headless state with no DOM or rendering. Use it to build your own tour.
The headless state machine behind <Tour>. It tracks the step index and groups, handles navigation and awaits each step's onBeforeEnter. It renders nothing and doesn't touch the DOM. <Tour> is useTour() plus a spotlight overlay and a Popover callout. Use the composable to build your own walkthrough UI, such as one animated with your own library, a callout that doesn't float, or an embedded panel.
Install
import { useTour } from 'vael-ui'Examples
import { ref } from 'vue'
import { useTour } from 'vael-ui'
import type { TourStep } from 'vael-ui'
const open = ref(false)
const steps: TourStep[] = [
{ target: '#new-doc', title: 'Create something new' },
{ target: '#share', title: 'Invite your team' },
]
const { currentStep, currentIndex, total, isFirst, isLast, isTransitioning, next, prev, skip } =
useTour(open, {
steps,
onFinish: () => console.log('tour finished'),
})
// Point your own spotlight and callout at currentStep.value.target.
// next(), prev() and skip() move the tour; isTransitioning is true while an
// onBeforeEnter is pending.
open.value = true