Vue API reference
The Vue adapter (@glowhop/vue-tour) exports components, hooks, and utility functions.
Functions
Section titled “Functions”createGlowTour(options?)
Section titled “createGlowTour(options?)”Creates a tour controller instance. Inherited from Core.
Signature:
function createGlowTour(options?: GlowTourOptions): TourComponents
Section titled “Components”GlowTourDefault
Section titled “GlowTourDefault”Pre-composed tour with overlay, popover, pointer, and all navigation buttons.
Props:
interface GlowTourDefaultProps { tour: Tour}Usage:
<GlowTourDefault :tour="tour" />GlowTour*
Section titled “GlowTour*”Composition primitives for custom layouts:
GlowTourRoot- Root containerGlowTourOverlay- Backdrop overlayGlowTourPointer- Decorative indicator/arrowGlowTourPopover- Dialog containerGlowTourHeader- Title areaGlowTourContent- Description areaGlowTourFooter- Navigation button containerGlowTourAdvanceTrigger- Next step buttonGlowTourBackTrigger- Previous step buttonGlowTourCancelTrigger- Dismiss button
These components are exported with both the GlowTour* naming convention shown above and as flat named exports: GlowTourRoot, GlowTourOverlay, GlowTourPointer, GlowTourPopover, GlowTourHeader, GlowTourContent, GlowTourFooter, GlowTourAdvanceTrigger, GlowTourBackTrigger, GlowTourCancelTrigger.
Props (GlowTourRoot):
interface GlowTourRootProps { tour: Tour class?: string style?: CSSProperties}GlowTourPointer (detailed)
Section titled “GlowTourPointer (detailed)”Customizes the directional content (emoji or custom content) of the pointer indicator.
Props:
interface GlowTourPointerProps { directionContent?: { top?: VNodeChild bottom?: VNodeChild left?: VNodeChild right?: VNodeChild } class?: string style?: CSSProperties}Default glyphs (when directionContent is not set):
top:👆bottom:👇left:👈right:👉
Usage (with custom content):
<GlowTourPointer :direction-content="{ top: '⬆️', bottom: '⬇️', left: '⬅️', right: '➡️' }"/>Usage (with custom component):
<GlowTourPointer :direction-content="{ bottom: SomeCustomComponent }"/>Usage (default pointers):
<GlowTourRoot :tour="tour"> <GlowTourOverlay /> <GlowTourPointer /> <GlowTourPopover> <GlowTourHeader /> <GlowTourContent /> <GlowTourFooter> <GlowTourCancelTrigger /> <GlowTourAdvanceTrigger /> </GlowTourFooter> </GlowTourPopover></GlowTourRoot>useTour()
Section titled “useTour()”Returns reactive tour state as a ref. Must be called inside <GlowTourRoot tour={...}>.
Signature:
function useTour(): ShallowRef<TourState<VueTourContent>>Returns:
ShallowRef<{ name: string totalSteps: number currentStepIndex: number currentStep: TourCurrentStep<VueTourContent> | null direction: "advance" | "previous" canAdvance: boolean canPrevious: boolean canCancel: boolean isFirstStep: boolean isLastStep: boolean status: "idle" | "starting" | "transitioning" | "active" | "finished" | "cancelled" | "error" | "disposed" error: Error | null}>Usage:
<script setup>import { useTour } from "@glowhop/vue-tour";
const state = useTour();</script>
<template> <div> <p>Status: {{ state.status }}</p> <button :disabled="!state.canAdvance" @click="tour.advance()"> Next </button> </div></template>Tour- Tour controllerTourState- Tour stateWorkflowDefinition- Immutable workflowStepPropsStore- Step state storeVueTourContent- Vue content typePointerDirectionContent- Content configuration forGlowTourPointercomponent directionsGlowTourOptions- Options forcreateGlowTourStartOptions- Options fortour.create
Exports
Section titled “Exports”export type { GlowTourOptions, StartOptions } from "@glowhop/core-tour";export { GlowTourDefault } from "./components/default-tour.js";export { GlowTourAdvanceTrigger, GlowTourBackTrigger, GlowTourCancelTrigger, GlowTourContent, GlowTourFooter, GlowTourHeader, GlowTourOverlay, GlowTourPointer, GlowTourPopover, GlowTourRoot, useTour,} from "./components/tour-components.js";export type { StepPropsStore, Tour, TourState, VueTourContent, WorkflowDefinition,} from "./glow-tour.js";export { createGlowTour } from "./glow-tour.js";