1.0.0 • Published 6 years ago

react-guided-tour v1.0.0

Weekly downloads
239
License
MIT
Repository
github
Last release
6 years ago

react-guided-tour

NPM JavaScript Style Guide

Install

npm install --save react-guided-tour

Usage

Please refer to the example folder

import React, { Component } from 'react';
import 'hopscotch/dist/css/hopscotch.css';
import { HopscotchContext, StartButton } from 'react-guided-tour';

export default class App extends Component {
  render () {

    const steps = [
      {
        title: 'Step 1',
        content: 'This is step 1',
        target: 'step1',
        placement: 'bottom',
      },
      {
        title: 'Step 2',
        content: '<p>This is <strong>step 2</strong></p>',
        target: 'step2',
        placement: 'top',
      }
    ];

    return (
      <div id="app">
        <HopscotchContext
          id="appTour"
          steps={steps}
          showPrevButton={true}
        >
          <StartButton>Help</StartButton>
        </HopscotchContext>
        <div id="container">
          <div id="left">
            <div id="step1"></div>
          </div>
          <div id="right">
            <div id="step2"></div>
          </div>
        </div>
      </div>
    )
  }
}

License

MIT © sorenhoyer