Registry / web-framework / vue3-tour

vue3-tour

JSON →
library1.0.3jsnpmunverified

`vue3-tour` is a lightweight, simple, and customizable tour plugin designed specifically for Vue.js 3 applications. It guides users through an application by highlighting elements and displaying contextual information in a step-by-step fashion. Currently at stable version 1.0.3, it is a direct fork of the popular `vue-tour` library, re-engineered for compatibility with the Vue 3 composition API and ecosystem. While release cadence isn't highly frequent, the project shows ongoing maintenance with recent fixes. Key differentiators include its ease of integration with Vue 3's `createApp` pattern, the ability to target any DOM element via standard CSS selectors, and support for asynchronous `before()` functions in steps for complex UI transitions. It ships with TypeScript types, enhancing developer experience in TypeScript projects.

npm install vue3-tour
INSTALL
IMPORT
SIG · VUE3-TOUR
V
vue3-tour
web-frameworkjavascriptv1.0.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Vue3Tour
import Vue3Tour from 'vue3-tour'
import { Vue3Tour } from 'vue3-tour'
This is the default export for the plugin itself, used with `app.use()` to register the tour functionality globally.
v-tour
// Used directly in Vue templates as <v-tour ...>
import { VTour } from 'vue3-tour'
The `<v-tour>` component is globally registered when the plugin is installed via `app.use(Vue3Tour)` and does not require explicit component import.
styles
import 'vue3-tour/dist/vue3-tour.css'
import 'vue3-tour/vue3-tour.css'
Essential for default styling of the tour steps, popovers, and navigation. Customize by overriding these styles or importing your own.
$tours
this.$tours['myTour'].start()
this.$tour.start()
Access the specific tour instance via the global property `$tours` on the Vue instance, using the `name` prop provided to the `<v-tour>` component.

Demonstrates how to install `vue3-tour`, register the plugin, include necessary styles, define tour steps targeting specific DOM elements, and programmatically start a guided tour.

// main.js import { createApp } from 'vue'; import App from './App.vue'; import Vue3Tour from 'vue3-tour'; import 'vue3-tour/dist/vue3-tour.css'; const app = createApp(App); app.use(Vue3Tour); app.mount('#app'); // App.vue <template> <div> <div id="v-step-0" style="margin: 20px; padding: 10px; border: 1px solid blue;"> A DOM element on your page. The first step will pop on this element. </div> <div class="v-step-1" style="margin: 20px; padding: 10px; border: 1px solid green;"> Another element for the second step. </div> <div data-v-step="2" style="margin: 20px; padding: 10px; border: 1px solid red;"> The final element for the third step. </div> <v-tour name="myTour" :steps="steps"></v-tour> <button @click="startTour">Start Guided Tour</button> </div> </template> <script> export default { name: 'App', data() { return { steps: [ { target: '#v-step-0', header: { title: 'Welcome!' }, content: `This is the starting point of our application tour.`, }, { target: '.v-step-1', content: 'Here you will find key information and functionalities.', }, { target: '[data-v-step="2"]', content: 'And this is where you can take action!', params: { placement: 'top' }, }, ], }; }, methods: { startTour() { if (this.$tours && this.$tours['myTour']) { this.$tours['myTour'].start(); } else { console.error("Tour 'myTour' not found. Ensure <v-tour name='myTour'> is rendered."); } }, }, mounted() { // Optionally start the tour automatically // this.startTour(); }, }; </script>
Debug
Known issues
breaking`vue3-tour` is a complete rewrite for Vue 3 and is incompatible with applications built for Vue 2 using the original `vue-tour` library. Direct migration requires updating plugin registration and component usage to Vue 3's API.
fix
Rewrite tour components and plugin registration to align with Vue 3's `createApp` API and component lifecycle. Update imports and component usage accordingly.
affects: >=1.0.0
gotchaTour popovers and navigation elements will appear unstyled or broken if the default CSS is not explicitly imported into your application.
fix
Add `import 'vue3-tour/dist/vue3-tour.css'` to your application's entry point (e.g., `main.js` or `main.ts`).
affects: >=0.1.0
gotchaIf a tour step's `target` selector (e.g., `#my-id`, `.my-class`, `[data-v-step="2"]`) does not match an existing DOM element when the step is activated, the tour step will fail to render correctly or may throw an error.
fix
Ensure the DOM element targeted by a step is rendered and available before `this.$tours['yourTour'].start()` or `nextStep()` is called. Utilize the `before()` hook within steps for asynchronous UI preparation if elements are conditionally rendered or loaded.
affects: >=0.1.0
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'start') or TypeError: this.$tours is undefined
The `v-tour` component, which registers the tour instance with the given name, has not been rendered or the plugin was not correctly installed via `app.use()`.
fix
Ensure `app.use(Vue3Tour)` is called in your `main.js/ts` file and that the `<v-tour name="yourTourName" :steps="steps"></v-tour>` component is present and rendered in your application's template hierarchy.
Module not found: Error: Can't resolve 'vue3-tour/dist/vue3-tour.css'
The import path for the CSS file is incorrect.
fix
Verify the import statement. It must be `import 'vue3-tour/dist/vue3-tour.css'`.
Tour steps are visible but lack styling (e.g., no arrows, misplaced popovers, basic browser button styling).
The default CSS for `vue3-tour` has not been imported or has been inadvertently overridden by other styles.
fix
Add `import 'vue3-tour/dist/vue3-tour.css'` to your application's entry file. If already present, inspect your application's styles for conflicts that might be overriding `vue3-tour`'s default CSS rules.
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies
vuerequiredPeer dependency required for Vue 3 integration
Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
vue3-tour — npm install vue3-tour · libregistry