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

react-ui-walkthrough

v1.0.2

Published

## Introduction <div align="center"> <img src="assets/example.png" alt="Example showing the tooltip" style="width: 500px; height: auto;"/> </div>

Downloads

10

Readme

React UI Walkthrough

Introduction

The React UI Walkthrough is a React-based library designed to guide users through a step-by-step tutorial within a web application. By providing contextual tooltips attached to specific elements on the page, the system offers interactive, on-the-spot guidance to enhance user understanding and improve the overall user experience.

Example

To use the Tutorial Tooltip System, wrap your application's main component with the TutorialProvider and pass an array of steps to it. Each step includes the ID of the target element, the text for the tooltip, and optional positioning and style properties. The TutorialProvider component accepts an optional dimStyle property, allowing the user to define custom styling for the dimming overlay effect.

Here's a basic example:

import './App.css'
import { HorizontalPosition, TutorialProvider, VerticalPosition } from 'react-ui-walkthrough';

const TutorialSteps=[
  {
    elementId: "a1",
    text: "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
    verticalPosition: VerticalPosition.Bottom,
    horizontalPosition: HorizontalPosition.Left,
    tooltipStyle: {
      color: 'yellow'
    }
  },
  {
    elementId: "a2",
    text: "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
    verticalPosition: VerticalPosition.Middle,
    horizontalPosition: HorizontalPosition.Center
  },
  {
    elementId: "a3",
    text: "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
    verticalPosition: VerticalPosition.Top,
    horizontalPosition: HorizontalPosition.Right
  }
];

function App() {

  return (<>
    <TutorialProvider steps={TutorialSteps} dimStyle={{
      backgroundColor: 'rgba(0, 0, 0, 0.6)'
    }} showTooltip={true}>
      <div>
        <h1 id="a1">This is main title</h1>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Veniam, mollitia id, facilis fuga natus eveniet non soluta molestias quibusdam voluptatibus dignissimos hic reprehenderit nisi odit vero sit saepe assumenda nam.</p>
      </div>
      <div>
        <button id="a2">Do something</button>
        <h2>This is subtitle</h2>
        <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Necessitatibus officiis perferendis harum beatae rem dignissimos error! Officia ab eaque eveniet, delectus vitae quis in suscipit illum doloribus alias nam aspernatur!</p>  
      </div>
      <button id="a3">This is lower button</button>  
      </TutorialProvider>
    </>
  )
}

export default App

Using Context

To access the TutorialContext within a child component, utilize the useContext hook that React provides. This enables you to retrieve the details of the current step and the entire list of tutorial steps.

import React, { useContext } from 'react';
import { TutorialContext } from 'react-ui-walkthrough';

const SomeChildComponent = () => {
  // Access the tutorial context
  const tutorialContext = useContext(TutorialContext);

  if (!tutorialContext) {
    // Handle the case where context is not available
    return null;
  }

  // Use tutorialContext to access the active step or steps array
  const { activeStep, steps } = tutorialContext;

  // Render something based on the context
  return <div>{`Current Step: ${steps[activeStep].text}`}</div>;
};