Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@mkpelletier/vuejs-tour

VueJS Tour is a lightweight, simple and customizable tour plugin. It provides a quick and easy way to guide your users through your application.

vue, vuejs, vue.js, vuejs-tour, tour, vuetour, vue-tour, vue3-tour, vue3tour, tour

readme

VueJS Tour

license docs build open issues Codacy Badge
version downloads producthunt

VueJS Tour is a lightweight, simple and customizable tour plugin. It provides a quick and easy way to guide your users through your application.

Table of Contents

Prerequisites

Installation

[!TIP] Looking for a nuxt version? Nuxt version (Special thanks to BayBreezy)

[!CAUTION] As of version 2.0.1, VueJS Tour has been rewritten in TypeScript. The VTour component is now a named export and must be imported as such. Please refer to the Documentation for more information on how to use VueJS Tour.





If you still want to use the old version, then this is the correct way to install it:

  • Step 1: Go to your project directory and install VueJS Tour using npm:
cd my-project
npm install @globalhive/vuejs-tour
  • Step 2: Import the plugin in your application entry point (typically main.js):
import { createApp } from "vue";
import App from "./App.vue";
import VueJsTour from '@globalhive/vuejs-tour';
import '@globalhive/vuejs-tour/dist/style.css';

const app = createApp(App)
  .use(VueJsTour)
  .mount("#app");

Everything is ready! Now you can use VueJS Tour in your application.
Make sure to check out the documentation for more information.

Create a tour

Add the VueJS Tour component anywhere in your app. It is recommended to add it to App.vue and create the required steps using <script setup> syntax.

<template>
  <div>
    <div id="selectByID">Selected by its id 'selectByID'</div>
    <p class="selectByClass">Telected by its class 'selectByClass'</p>
    <button data-step="3">Selected by the 'data-step="3"' attribute</button>

    <VTour :steps="steps"/>
  </div>
</template>

<script setup>
const steps = [
  {
    target: '#selectByID',
    content: 'This is the first step',
  },
  {
    target: '.selectByClass',
    content: 'This is the second step, placed on the bottom of the target',
    placement: 'bottom',
  },
  {
    target: '[data-step="3"]',
    content: 'This is the third step',
  }
];
</script>

Start the tour

To start the tour, you can use the autoStart prop...

<template>
  <div>
    <div id="selectByID">Selected by its id 'selectByID'</div>
    <p class="selectByClass">Telected by its class 'selectByClass'</p>
    <button data-step="3">Selected by the 'data-step="3"' attribute</button>

    <VTour :steps="steps" autoStart/>
  </div>
</template>

<script setup>
const steps = [...];
</script>

...or call the startTour() method on the component instance.

<template>
  <div>
    <div id="selectByID">Selected by its id 'selectByID'</div>
    <p class="selectByClass">Telected by its class 'selectByClass'</p>
    <button data-step="3">Selected by the 'data-step="3"' attribute</button>

    <VTour ref="tour" :steps="steps"/>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue';
const tour = ref(null);

const steps = [...];

onMounted(() => {
  tour.value.startTour();
});
</script>

The target property of the step object can be any valid CSS selector.

Documentation

For more information about the available props and methods, check out the documentation.

Something Missing?

If you have a feature request or found a bug, let us know by submitting an issue.

changelog

Changelog

2.3.0 (2024-09-22)

Features

  • Step: Added backdrop option to step (8b2824e)
  • Step: Added highlight option to steps (95ea9f9)
  • Step: Added noScroll option to step (6f60ba6)
  • Step: Added onAfter callback (09f3fea)
  • Step: Added onBefore callback to step (15f0c7a)
  • VTour: Added OnTourStep emit (ce0687c)

Bug Fixes

  • VTour: Fixed stopping tour not removing backdrop & highlight (408f5af)

2.2.0 (2024-09-17)

Features

  • Added Clip-Path Highlight (66a0bae)

2.1.1 (2024-07-10)

Bug Fixes

  • package: Fixed wrong scripts (4438349)

2.1.0 (2024-07-05)

Features

  • VTour: Added noScroll prop (7ad9141)

Bug Fixes

  • VTour: Fixed tooltip not scrolling with target (ffbe9d9)
  • VTour: Fixed wrong scrolling call (b644a86)

2.0.2 (2024-07-05)

Bug Fixes

  • Step: Fixed placement not working (f16ec0f)

2.0.1 (2024-07-05)

Bug Fixes

  • Package: Fixed not using npm (c9c046b)
  • Workflow: Fixed NPM release (a053465)

2.0.0 (2024-07-05)

⚠ BREAKING CHANGES

  • VTour: Removed the plugin approach, switched to component import
  • Deps: Switched from popperjs to nanopop

Features

  • VTour: Added margin prop
  • VTour: Added hideSkip prop
  • VTour: Added hideArrow prop
  • VTour: Added Typescript
  • VTour: Complete rewrite of the component

Bug Fixes

  • VTour: Fixing the highlight using document space
  • VTour: Fixing wrong saveToLocalStorage checks

1.7.0 (2024-07-05)

Features

  • Docs: Adding docs using vitepress (633b017)
  • Project: Added Typescript (2d80e28)

1.6.1 (2024-06-03)

Bug Fixes

  • VTour: Fixed not resetting on resetTour() #54 (fbfc970)

1.6.0 (2024-03-27)

Features

  • VTour: Added prop 'backdrop' to enable a backdrop / disabling controls #45 (a5e21f9)

Bug Fixes

  • npm: Updated packages (081b0b7)
  • VTour: Fixed backdrop not disabling after tour end (d122180)
  • VTour: Fixed tour showing on error (No Target) #48 (6b3f664)

1.5.0 (2024-01-04)

Features

  • VTour: Added goToStep function (2f4e8b2)

Bug Fixes

  • actions: Fixed workflow automation (28d458b)

1.4.0 (2023-12-29)

Features

  • VTour: Added saveToLocalStorage prop (885bc8b)

1.3.9 (2023-12-23)

Bug Fixes

  • actions: Fixed docs action (959394c)
  • actions: Fixed npm action (ada714f)
  • actions: Fixed release action (3ca0fbb)

1.3.8 (2023-12-22)

Bug Fixes

  • VTour: Fixed non async code (aa583c6)

1.3.7 (2023-10-16)

Bug Fixes

  • version: Updated version number (8d3c1b9)

1.3.6 (2023-05-22)

Bug Fixes

  • component: Skip text is hardcoded, should be read from component's props (c7152a5)
  • docs: Document incorrect about buttonLabel property which should be buttonLabels instead #27 (a30f9dc)

1.3.5 (2023-04-19)

Bug Fixes

  • component: Hide Previous button on #actions overwrite #25 (dec6fae)

1.3.4 (2023-01-26)

Bug Fixes

  • component: Fixed error on first step / no highlight #20 (968e37a)

1.3.3 (2023-01-09)

Bug Fixes

  • component: Fixed exception when tour finishes #18 (9d745cf)
  • docs: Fixed create a tour link (cc1cbf1)

1.3.2 (2022-12-18)

Bug Fixes

  • readme: Fixed shields url (3ce98c4)
  • vite: Excluded jump.js from build (7ef4cff)

1.3.1 (2022-12-12)

Bug Fixes

  • docs: Fixed wrong css import (fa5d356)

1.3.0 (2022-12-12)

Features

  • callbacks: Added onTourStart and onTourEnd callback (008f798)

1.2.0 (2022-12-12)

Features

  • options: Added onShow() option - resolves #10 (b2d88e8)

Bug Fixes

  • highlight: Changed highlight border to outline to not take more space (87b1cdf)
  • steps: Fixed steps breaking when targets aren't found - fixes #9 (9c3d9f8)

1.1.0 (2022-12-10)

Features

  • docs: Included tour example (7796e69)
  • jumpjs: Added jump.js for smooth scrolling (8001f5c)

Bug Fixes

  • component: Button cursor not pointer (3aea1f3)
  • component: Page not scrolling to top after tour (f47ad5b)
  • component: Removing highlight (d35877b)
  • component: Target highlighted even without highlight prop (bcfd70a)

1.0.5 (2022-12-10)

Bug Fixes

  • style: variables not set to default (fad38fe)
  • workflows: workflows not running automatically, temporarely set to manual (36f826f)

1.0.4 (2022-12-10)

Bug Fixes

  • workflows: workflows not running automatically (a02959f)

1.0.3 (2022-12-10)

Bug Fixes

  • build: style.css not included by vite (6bf83bb)
  • workflows: workflows not running automatically (9041f03)

1.0.2 (2022-12-10)

Bug Fixes

1.0.1 (2022-12-09)

Miscellaneous Chores

1.0.0 (2022-12-09)

Features

  • component: Added onNext and onPrev functions (7d68a64)
  • component: Added tour finished to localstorage (466659f)
  • component: Added tour finished to localstorage (7e340a7)
  • docs: Added documentation (1ba9859)
  • package: Added npm definitions (9a1d371)
  • vuejs-tour: created component (99a3088)

Bug Fixes

  • docs: Fixed missing package error (5994f85)
  • package: fixed formatting (50eba1c)
  • package: Fixed pop up showing before start (6d1feaa)