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

@nlo/onboarding-tour

v1.6.3

Published

A vue plugin for a step by step interactive onboarding tour.

Downloads

307

Readme

Onboarding tour

A vue plugin for a step by step interactive onboarding tour.

Installation

You can install the package through NPM.

npm install @nlo/onboarding-tour

Usage

Import and register the plugin:

import OnboardingTour from "@nlo/onboarding-tour";

Vue.use(OnboardingTour);

Include the tour component in the template of the page or view you want to use it. This must be in an overarching component which contains all the steps of that specific onboarding. Provide it with a unique name to distinguish it from other onboarding tours in your website.

<onboarding-tour name="myTour1" :steps="onboardingSteps"></onboarding-tour>

Provide an array of onboardingSteps as vue component data:

export default {
	data() {
		return {
			onboardingSteps: [
				{ description: "New feature 1" },
				{ description: "New feature 2" },
			],
		};
	},
};

In your template add data attributes for each step in the same order that you defined your onboardingSteps array:

Parameters:

  • data-tour-action-data: Contains a string that is passed to the action that can be set in JS.
  • data-tour-description-data: Contains a JSON string that is used as input for making the description of the step dynamic (using {{my-variable}} syntax)
<template>
	<div class="feature-1" data-tour-step="1"></div>
	<div
		class="feature-2"
		data-tour-step="2"
		data-tour-action-data="data that needs to be passed to the action of this step"
		data-tour-description-data='{"my-variable": 12}'
	></div>

	<onboarding-tour name="myTour1" :steps="onboardingSteps"></onboarding-tour>
</template>

Finally start the onboarding when you want to present it to the user, for example in the mounted hook:

mounted() {
  this.$onboarding.start('myTour1', { localStorageKey: 'myTour1' });
}

You can add some optional interface options

mounted() {
  this.$onboarding.start('myTour1', {
    localStorageKey: 'myTour1',
    interfaceOptions: {
      hideSteps: true, // default is false
      hideStop: true, // default is false
      stopText: 'Stop text', // default is 'Stoppen'
      endText: 'The end', // default is 'Ok, klaar!'
      nextText: 'Next' // default is 'Ok, ga verder'
    }
  });
}

A built in local storage mechanism is available if you pass a local storage key as part of the second options object argument. This allows you to easily show the tour to the user once.

Additional configuration

The step object in the steps prop array you provide to the plugin has a few additional options to allow for more useful interaction.

{
  // Description text for inside the tooltip for that step
  description: 'New feature 1',
  // Optional: Title for inside the tooltip fot that step, above the description
  title: 'Title',
  // Optional: See popper.js tooltip placement string options
  tooltipPlacement: 'bottom-start',
  // Optional: Execute code on the action hook to for example open a drawer for that specific feature highlight
  action: () => {
    this.openDrawer();
  },
  // Optional: Delay in milliseconds to for example wait for the action of the previous step to finish first
  delay: 300.
  // Optional: CSS selector to find the target element (overrides data-tour-step feature)
  target: '#feature1-complex-control'
}