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

lite-user-guiding

v1.0.3

Published

Lite User Guiding is a lightweight and flexible library for showcasing new features in web systems. It uses interactive tooltips with titles and descriptions defined via JSON, allowing you to highlight DOM elements and provide a guided experience for user

Downloads

59

Readme

Lite User Guiding

Lite User Guiding is a lightweight and flexible library for highlighting new features in web applications. It allows you to showcase DOM elements using interactive tooltips, providing a guided user experience. Tooltips are defined via a JSON configuration, making it easy to manage and update feature highlights.

🚀 Features

Lightweight: Minimal footprint for fast and efficient integration. JSON-based Configuration: Define tooltips with ease. Interactive Tooltips: Highlight DOM elements with titles and descriptions. Customizable: Style the tooltips to match your application's design. Perfect for Onboarding and Feature Launches.

📦 Installation

Install the library via npm:

npm install lite-user-guiding

Or use Yarn:

yarn add lite-user-guiding

🛠️ Usage

  1. Import the library
import { LiteUserGuiding } from 'lite-user-guiding';
  1. Add the JSON configuration Define your tooltips in a JSON file:
{
  "version": "1.0.0",
  "url": "https://someurl.com/page-target",
  //notification browser config
  "notificationTitle": "New system version available",
  "notificationBody": "There's a new version of the OMS features. Click to check out what's new.",
  "notificationIcon": "/path/your-image",
  //end notification browser config
  "features": [
    {
      "title": "New feature-sample available",
      "description": "With the new feature-sample, you'll be able to use various resources.",
      "data-feature": "feature-name"
    }
  ]
}
  1. In the feature you want to present, add the data attribute data-feature="feature-name".

  2. Initialize the guide (Using reactJs)

import { useEffect } from 'react';
import ShowNewFeature from 'lite-user-guiding';

function App() {
  useEffect(() => {
    const config = {
      tooltipSelector: '#tooltip',
      tooltipContentSelector: '#tooltipContent',
      overlaySelector: '#overlay',
      nextButtonSelector: '#nextButton',
      dataUrl: '/features/features.json', // JSON file with tooltip data
    };

    const showNewFeature = new ShowNewFeature(config);
    showNewFeature.init();
  }, []);

  return (
    <div>
      <h1>Welcome to the App!</h1>
      <button id="nextButton">Next</button>
      <div id="tooltipContent"></div>
      <div id="overlay"></div>
    </div>
  );
}

export default App;

Using bundling tools like Webpack, Parcel, or Vite

// JS File, like main.js
import ShowNewFeature from 'lite-user-guiding';

// Starting the library
document.addEventListener('DOMContentLoaded', () => {
  const config = {
    tooltipSelector: '#tooltip',
    tooltipContentSelector: '#tooltipContent',
    overlaySelector: '#overlay',
    nextButtonSelector: '#nextButton',
    dataUrl: '/features/features.json',
  };

  const showNewFeature = new ShowNewFeature(config);
  showNewFeature.init();
});

HTML File

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Lite User Guiding</title>
</head>
<body>
  <div id="tooltip"></div>
  <div id="tooltipContent"></div>
  <button id="nextButton">Next</button>
  <div id="overlay"></div>

  <script src="dist/main.js"></script> <!-- Aqui vai o bundle gerado -->
</body>
</html>

⚙️ Configuration Options

| Option | Type | Default | Description | |-------------------------|------------|--------------|-------------------------------------------------------------------| | tooltipSelector | string | '#tooltip' | Selector for the tooltip container element. | | tooltipContentSelector| string | '#tooltipContent' | Selector for the element displaying tooltip content. | | overlaySelector | string | '#overlay' | Selector for the overlay element to focus on tooltips. | | nextButtonSelector | string | '#nextButton' | Selector for the "Next" button in the tooltip. | | dataUrl | string | null | URL for fetching tooltip configuration as a JSON file. |

🎨 Customization

Customize the tooltips by overriding the default CSS styles:

#tooltip {
  position: absolute;
  background-color: #333;
  color: #fff;
  padding: 10px;
  border-radius: 5px;
  z-index: 1000;
  display: none;
  max-width: 450px;
}

#tooltip h2 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  border-bottom: solid 1px rgba(255, 255, 255, 0.4);
  padding-bottom: 15px;
}

#tooltip p {
  font-size: 1rem;
  margin-bottom: 20px;
}

#tooltipContent {
  margin-bottom: 10px;
}

#nextButton {
  background-color: #007bff;
  color: #fff;
  border: none;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
}

#nextButton:hover {
  background-color: #0056b3;
}

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}

🧑‍💻 Contributing

We welcome contributions! Feel free to submit issues, feature requests, or pull requests.

📜 License

Lite User Guiding is licensed under the MIT License.

📬 Contact

For questions or support, feel free to open an issue or reach out via email: [email protected]

Start guiding your users today with Lite User Guiding! 🎉