npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tour-guide-turbham

v0.0.7

Published

A customizable tour guide component for Vue 3 applications that highlights elements and guides users through different steps.

Downloads

37

Readme

Vue Tour Guide Component

A customizable tour guide component for Vue 3 applications that highlights elements and guides users through different steps.

Table of Contents

Features

  • Customizable steps with dynamic content
  • Smooth scrolling to elements
  • Highlighting elements with tooltips
  • Configurable positioning of tooltips
  • Automatic progression through steps
  • Resize handling

Installation

npm install tour-guide-turbham

Usage

  1. To use the tour guide in your Vue project, import the component and the CSS file:
import { createApp } from "vue";
import App from "./App.vue";
import "tour-guide-turbham/dist/style.css";

const app = createApp(App);

app.mount("#app");
  1. Import the TourGuide component into your Vue application.
<template>
  <div id="app">
    <TourGuide :steps="steps" :startTour="true" :showGuideInterVal="4500" />
    <!-- Other content -->
  </div>
</template>

<script setup>
import { ref } from "vue";
import TourGuide from "./components/TourGuide.vue";

const steps = ref([
  {
    component: "StepComponent1",
    attachTo: { element: "#element1", on: "bottom" },
    stepFunction: () => console.log("Step 1 action"),
  },
  {
    component: "StepComponent2",
    attachTo: { element: "#element2", on: "right" },
    stepFunction: () => console.log("Step 2 action"),
  },
  // Add more steps as needed
]);
</script>

Each step is an object that can contain these properties:

const step = {
  component: Component,
  attachTo: {
    element: "#element3",
    on: "right",
  },
  text: "Click here to view all user settings",
  width: "max-w-[206px]", // Tailwind CSS styles
  offset: 48, // Guide offset from attached element
  stepFunction: () => console.log("Step action"), // Function ro run in current step
};

Props

| Prop | Type | Required | Default | Description | | ------------------- | ------- | -------- | ------- | --------------------------------------------- | | steps | Array | Yes | - | Array of step objects defining the tour steps | | startTour | Boolean | No | false | Automatically start the tour on mount | | startOnMount | Boolean | No | true | Start the tour when the component is mounted | | showGuideInterVal | Number | No | 4500 | Time interval in milliseconds between steps |

Events

The component provides several events to handle tour actions. These events can be used within the scope of the tour guide:

| Event Name | Description | | ---------- | ------------------------------------ | | nextStep | Fired when the tour is ended. | | endTour | Fired when the next step is reached. |

Example

Here is a complete example of using the TourGuide component in a Vue 3 application:

<template>
  <div id="app">
    <TourGuide :steps="steps" :startTour="true" :showGuideInterVal="4500" />
    <div id="element1">Step 1 target element</div>
    <div id="element2">Step 2 target element</div>
  </div>
</template>

<script setup>
import { ref } from "vue";
import TourGuide from "./components/TourGuide.vue";

const steps = ref([
  {
    component: "StepComponent1",
    attachTo: { element: "#element1", on: "bottom" },
    stepFunction: () => console.log("Step 1 action"),
  },
  {
    component: "StepComponent2",
    attachTo: { element: "#element2", on: "right" },
    stepFunction: () => console.log("Step 2 action"),
  },
  // Add more steps as needed
]);
</script>

Components

GuideWrapper

The GuideWrapper component is used to wrap the content of each step in the tour.

Guide

The Guide component is used to display the content of each step in the tour. You can use it in the steps array by specifying it as the component.

const steps = ref([
  {
    attachTo: {
      element: "#step1",
      on: "bottom",
    },
    text: "This is step 1",
    component: "Guide",
  },
  {
    attachTo: {
      element: "#step2",
      on: "top",
    },
    text: "This is step 2",
    component: "Guide",
  },
  // Add more steps as needed
]);

Credits

This NPM package was developed by Tobiloba Odukoya.