useTour API
createStep, createRegistry, and createForm.Related
Explore these related pages for additional context and usage patterns.
| Page | Category |
|---|---|
| useTour | Plugins |
| Tour | Disclosure |
| createStep | Selection |
| createForm | Forms |
| createRegistry | Registration |
Functions
createTourContext
(_options?: TourContextOptions) => ContextTrinity<TourContext<Z, E>>Creates a tour context with dependency injection support.
createTourPlugin
(_options?: TourPluginOptions) => PluginInstalls one tour on the app. useTour() reads it during component setup.
A local provide from createTourContext shadows it for that subtree.
The plugin does not store a catalog. Stop the running tour, clear its
steps, and onboard the next tour's steps. Leave activators registered.
reset() clears those too.
useTour
(namespace?: string) => TourContext<Z, E>Returns the current tour context from dependency injection.
Properties
steps
StepContext<Z, E>activators
RegistryContext<TourActivatorTicketInput, TourActivatorTicket<TourActivatorTicketInput>>form
FormContext<FormTicketInput, FormTicket<FormTicketInput>>isActive
Readonly<ShallowRef<boolean>>isComplete
Readonly<ShallowRef<boolean>>isReady
Readonly<ShallowRef<boolean>>isFirst
Readonly<Ref<boolean, boolean>>isLast
Readonly<Ref<boolean, boolean>>canGoBack
Readonly<Ref<boolean, boolean>>canGoNext
Readonly<Ref<boolean, boolean>>selectedId
Readonly<Ref<ID | undefined, ID | undefined>>total
numberMethods
complete
() => Promise<void>Dismiss and mark complete. Emits completed for the current step.
Resolves after an in-flight next() or step() finishes that completion,
or after its gate drops it. From inside the submit that gate is already
awaiting, it requests completion and resolves so that submit can finish.
next
() => Promise<void>Advance one step. No-op while inactive, unready, or on the last step. Validates the current form field when one is registered under this step id.
prev
() => Promise<void>Move back one step. No-op while inactive, unready, or on the first step.
Does not validate and does not emit completed.
step
(index: number) => Promise<void>Jump to a 1-based step index. Validates when leaving a form step.
activate
(target: MaybeElementRef, options?: TourActivateOptions) => voidRegister a programmatic activator for the current step.
ready
(stepId: ID, visit: number) => voidMark this entry ready from outside the handler. No-op unless the tour is
active, stepId is still selected, and visit is the token from that
entry's context.