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

@guiderjs/vanilla

v0.2.7

Published

Customizable library for creating guide on your website.

Downloads

43

Readme

Guiderjs Vanilla

Get started

# npm
$ npm install @guiderjs/vanilla
# yarn
$ yarn add @guiderjs/vanilla

usage

<!-- index.html -->
<div>
  <div class="card">Card content</div>
</div>
// index.ts
import Guider, { Step } from "@guiderjs/vanilla";
// guider steps
const steps: Step[] = [{ key: "card", target: ".card" }];
// guider instance
const guider = new Guider({ steps });
// start guider
guider.start();

API

Guider

class Guider {
  /**
   * start guider from the step has given key, if no step key given, start from the first step.
   * guider needs to be `show` or `stop` status
   * @param stepKey key of the step to start
   */
  start: (stepKey?: string) => void;
  /**
   * go to next step, if current step is the last step, exit
   */
  next: () => void;
  /**
   * go back one step, if current step is the first step, do nothing.
   */
  back: () => void;
  /**
   * exit guider
   */
  exit: () => Promise<void>;
  /**
   * unmount guider container
   */
  unmount: () => void;
}

Option

| props | description | type | default | | ------------------------ | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | --------- | | steps (required) | an array contains info of guider steps | Step[] | - | | boundary | selector of boundary element | string | - | | onStart | the callback function when guider start | () => void | - | | onExit | the callback function when guider exited | () => void | - | | target | selector to select target (highlighted) element | string | - | | targetClass | className of target | string | - | | preventTarget | if prevent interaction of origin target element | boolean | true | | onTargetClick | the callback function when user click target (highlighted) part | () => void | - | | overlayColor | background color of overlays | string | "#333333" | | overlayOpacity | opacity of overlays | number | 0.5 | | overlayClass | className of overlays | string | - | | zIndex | zindex property of guider container | number | 99999 | | popover | popover element | Element | - | | popoverPosition | position of popover (works when you have popover) | "auto" | "center" | "target-top" | "target-bottom" | "target-left" | "target-right" | "auto" | | popoverAnchor | popover position to target | "start"|"middle"|"end" | "middle" | | popoverGap | gap (px) between popover and target, (works when you have popover and target) | number | 8 | | popoverLeft | left property of popover | string | "0px" | | popoverTop | top property of popover | string | "0px" | | popoverAnimation | popover animation name | string | "flip-y" | | popoverAnimationDuration | popover animation duration | string | "400ms" | | popoverAnimationFunction | popover animation timing function | string | "ease" | | onStepStart | the callback function when step start | (step:Step,index:number) => void | - | | onStepExit | the callback function when step exit | (step:Step,index:number) => void | - |

Step

(info of one guider step, will override component props)

| property | description | type | default | | ------------------------ | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | --------- | | key (required) | unique key of step | string | - | | target | selector to select target (highlighted) element | string | - | | targetClass | className of target | string | - | | preventTarget | if prevent interaction of origin target element | boolean | true | | onTargetClick | the callback function when user click target (highlighted) part | () => void | - | | overlayColor | background color of overlays | string | "#333333" | | overlayOpacity | opacity of overlays | number | 0.5 | | overlayClass | className of overlays | string | - | | zIndex | zindex property of guider container | number | 99999 | | popover | popover element | Element | - | | popoverPosition | position of popover (works when you have popover) | "auto" | "center" | "target-top" | "target-bottom" | "target-left" | "target-right" | "auto" | | popoverAnchor | popover position to target | "start"|"middle"|"end" | "middle" | | popoverGap | gap (px) between popover and target, (works when you have popover and target) | number | 8 | | popoverLeft | left property of popover | string | "0px" | | popoverTop | top property of popover | string | "0px" | | popoverAnimation | popover animation name | string | "flip-y" | | popoverAnimationDuration | popover animation duration | string | "400ms" | | popoverAnimationFunction | popover animation timing function | string | "ease" | | onStepStart | the callback function when step start | (step:Step,index:number) => void | - | | onStepExit | the callback function when step exit | (step:Step,index:number) => void | - | | payload | step payload | any | - |