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

guidy

v0.0.4

Published

**Guidy.js** is a lightweight JavaScript library that allows you to create step-by-step user guides and onboarding experiences on web pages. It provides an easy way to highlight elements, show tooltips, and guide users through different steps of your web

Downloads

9

Readme

Guidy.js

Guidy.js is a lightweight JavaScript library that allows you to create step-by-step user guides and onboarding experiences on web pages. It provides an easy way to highlight elements, show tooltips, and guide users through different steps of your web application.

Features

  • Step-by-step guidance: Guide users through a series of steps.
  • Highlight elements: Focus on specific elements during each step.
  • Positioning: Display guidance elements on the top, right, bottom, or left of the target element.
  • Customizable content: Add text, images, and videos to each step.
  • Progress display: Show current progress in multi-step guides.
  • Loop steps: Allow the guide to restart from the first step after the last step is completed.
  • Close and navigate steps: Add next, previous, and close buttons to navigate the guide.
  • Scroll to elements: Automatically scroll to elements during the guide.

Installation

You can include Guidy.js in your project via npm:

npm install guidy

Or use it directly via a CDN:

<script src="https://unpkg.com/guidy@latest/guidy.js"></script>
<script src="https://cdn.jsdelivr.net/npm/guidy@latest/guidy.js"></script>

Usage

Basic Setup

  1. Import or include guidy.js in your project.
  2. Create a new instance of Guidy and pass the steps as an array of objects.

Each step should contain:

  • selector: The CSS selector of the target element.
  • title: The title of the guide step.
  • description: The description of the guide step.
  • position: The position of the guide tooltip relative to the element (top, right, bottom, left).
  • image: (Optional) Image URL to display in the guide step.
  • video: (Optional) Video URL to display in the guide step.
  • scroll: (Optional) Whether to scroll to the element.
import Guidy from 'guidy';

const steps = [
    {
        selector: "#element1",
        title: "Step 1",
        description: "This is the first step",
        position: "top",
        image: "image1.jpg",
        scroll: true
    },
    {
        selector: "#element2",
        title: "Step 2",
        description: "This is the second step",
        position: "right",
        video: "video1.mp4",
    }
];

const guidy = new Guidy({
    steps: steps,
    loop: true, // Optional: Loop steps when completed
    progress: true // Optional: Show progress of steps
});

// Start the guide
guidy.play();

Methods

play()

Starts the guide from the first step.

guidy.play();

playStep(stepNum)

Plays a specific step by its step number (stepNum). This method allows you to jump to any step in the guide.

// Jump to step 2 (index 1)
guidy.playStep(1);
  • Parameters:

    • stepNum: (number) The step index to play.
  • Usage: You can use playStep() to start at any specific step, navigate to a certain step programmatically, or handle custom user actions that move them to a specific guide step.

  • Example:

// Example to skip to the second step directly
guidy.playStep(1);

close()

Closes the guide.

guidy.close();

Step Object Properties

  • selector: (string) CSS selector of the element to highlight.
  • title: (string) Title of the step.
  • description: (string) Description of the step.
  • position: (string) Position of the tooltip (top, right, bottom, left).
  • image: (optional, string) URL of an image to display.
  • video: (optional, string) URL of a video to display.
  • scroll: (optional, boolean) Scroll the page to the selected element.

Options in Constructor

  • steps: (array) Array of step objects.
  • loop: (boolean) If true, the guide will loop back to the first step when completed.
  • progress: (boolean) If true, shows the current step number and total steps.

Example

const steps = [
    {
        selector: "#header",
        title: "Welcome!",
        description: "This is the header section of the page.",
        position: "bottom",
        scroll: true
    },
    {
        selector: "#content",
        title: "Content Section",
        description: "This is the main content section.",
        position: "right"
    },
    {
        selector: "#footer",
        title: "Footer",
        description: "This is the footer of the page.",
        position: "top"
    }
];

const guidy = new Guidy({
    steps: steps,
    loop: false,
    progress: true
});

guidy.play();

Styling

You can customize the appearance of the guide by modifying the CSS styles applied in the script or by applying your own styles via external CSS.

Default Style (CSS)

#guidy_el {
    position: absolute;
    padding: 5px;
    color: black;
    z-index: 9999;
}

.guidy_el_container {
    box-shadow: 0px 10px 15px -3px rgba(0,0,0,0.2);
    padding: 15px;
    width: 300px;
    border-radius: 5px;
    background: white;
}

.guidy_el_btns button {
    background: black;
    color: white;
    width: 80px;
    height: 30px;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

#guidy_el #close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 20px;
    cursor: pointer;
}

License

Guidy.js is open-source software licensed under the MIT License.


Feel free to contribute, open issues, or suggest improvements!