1.2.9 • Published 5 years ago

react-guide v1.2.9

Weekly downloads
28
License
ISC
Repository
-
Last release
5 years ago

react-guide

A reactjs component is used for web page guidance

Table of Contents

Installation

To install, you can use npm

$ npm install react-guide

API documentation

PropertyDescriptionTypeDefault
visibleWhether the guide is visible or notbooleanfalse
audioWhether a voice reads of tip of the guide or notbooleantrue
lanThe voice of language, 'en' or 'zh'stringen
bulletWhether bullets (.) button is visible on middle of the guide or notbooleanfalse
numWhether num icon is visible on top left of the guide or notbooleanfalse
onCancelSpecify a function that will be called when a user clicks shadow, skip button on bottom leftfunction(e)-
onOkSpecify a function that will be called when all steps have done and click the done buttonfunction(e)-
data-stepNumber of steps for guides, only use in domstring-
data-tipEvery step you want to show tip, only use in domstring-

Examples

Here is a simple example of react-guide being used in an app

import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import Guide from 'react-guide'
class App extends Component {
  constructor () {
    super()
    this.state = {
      visible: false
    }
  }
  handleStart() {
    this.setState({
      visible: true
    })
  }
  handleCancel() {
    this.setState({
      visible: false
    })
  }
  render() {
    return (
      <div>
        <Guide 
          visible={this.state.visible} 
          onCancel={this.handleCancel.bind(this)} >
            <h1 data-step="1" data-tip='Hello World'>Step1</h1>
            <div data-step="3" data-tip='Welcome to use react-guide'>Step3</div>
            <h4 data-step="2" data-tip='react-guide is very easy' >Step2</h4>
            <div><span data-step="4" data-tip='Let start'>Step4</span></div>
      </Guide>
      <button onClick={this.handleStart.bind(this)}>start</button>
    </div>
    );
  }
}
ReactDOM.render(<App />, document.getElementById('root'));

You can find more examples in the examples directory, which you can run in a local development server using npm start.

demo

This is a demo show guide demo

1.2.9

5 years ago

1.2.8

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago