react-shepherd

NPM

react-shepherd downloads react-shepherd version react-shepherd license

react-shepherdSimilar Packages:

Npm Package Weekly Downloads Trend

3 Years
🌟 Show real-time usage chart on react-shepherd's README.md, just copy the code below.
## Usage Trend
[![Usage Trend of react-shepherd](https://npm-compare.com/img/npm-trend/THREE_YEARS/react-shepherd.png)](https://npm-compare.com/react-shepherd#timeRange=THREE_YEARS)

Cumulative GitHub Star Trend

🌟 Show GitHub stars trend chart on react-shepherd's README.md, just copy the code below.
## GitHub Stars Trend
[![GitHub Stars Trend of react-shepherd](https://npm-compare.com/img/github-trend/react-shepherd.png)](https://npm-compare.com/react-shepherd)

Stat Detail

Package
Downloads
Stars
Size
Issues
Publish
License
react-shepherd19,66113,684155 kB4611 days agoAGPL-3.0

README for react-shepherd

react-shepherd

NPM

This is a React wrapper for the Shepherd tour library. It's mainly a wrapper around the Shepherd library that exposes the tour object and methods to the context object that can be passed into props for dynamic interactivity.

Install

Use this simple NPM command or whatever package manager is your favorite.

npm install --save react-shepherd

Usage

Via Provider/Context

import { Component, useContext } from 'react';
import { ShepherdJourneyProvider, useShepherd } from 'react-shepherd';
import newSteps from './steps';

const tourOptions = {
  defaultStepOptions: {
    cancelIcon: {
      enabled: true
    }
  },
  useModalOverlay: true
};

function Button() {
  const Shepherd = useShepherd();
  const tour = new Shepherd.Tour({
    ...tourOptions,
    steps: newSteps
  });

  return (
    <button className="button dark" onClick={tour.start}>
      Start Tour
    </button>
  );
}

export default function App() {
  return (
    <div>
      <ShepherdJourneyProvider>
        <Button />
      </ShepherdJourneyProvider>
    </div>
  );
}

Configuration

The following configuration options for a tour can be set on the useShepherd hook to control the way that Shepherd is used. This is simply a POJO passed to Shepherd to use the options noted in the Shepherd Tour options.

License

react-shepherd is licensed under AGPL-3.0 (for open source and non-commercial use) with a Commercial License available for commercial use.

  • Free for open source and non-commercial projects under AGPL-3.0
  • Commercial license required for commercial products and revenue-generating companies

šŸ“„ Read License Details
šŸ’³ Purchase Commercial License