Package Exports
- rc-tour-guide
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rc-tour-guide) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
rc-tour-guide
React tour guide or introduction for user is first time using.
Development
npm install
npm start
Example
http://localhost:8000/examples/
online example: http://xuqingkuang.github.io/rc-tour-guide/
install
Usage
import React from 'react';
import ReactDOM from 'react-dom';
import { tourGuideMixin } from 'rc-tour-guide';
require('rc-tour-guide/assets/index.less');
require('./style.less');
const tour = {
startIndex: 0,
scrollToSteps: true,
steps: [
{
text: 'This is the first step in the tour.',
selector: '.block',
},
{
text: 'This is the second step in the tour.',
selector: '.inline-block',
placement: 'right-bottom'
},
{
text: 'This is the third step in the tour.',
selector: '.float-right',
placement: 'left-middle',
},
{
text: 'This is the fourth step in the tour.',
selector: '.position-absolute',
placement: 'top-right',
}
]
};
const cb = function() {
console.log('User has completed tour!');
};
const TourGuide = React.createClass({
mixins: [ tourGuideMixin(tour, cb) ],
componentDidMount: function() {
this.showTourGuide();
},
render: function() {
return (
<div>
<div>
<button onClick={this.showTourGuide}>
Show Tour Guide
</button>
<button onClick={function(evt) { this.showTourGuide(evt, true) }.bind(this)}>
Reset and Show Tour Guide
</button>
</div>
<div className="block">
I am a block text.
</div>
<div>
<span className="inline-block">
I am a inline-block text
</span>
</div>
<div className="float-right">
I am float right text.
</div>
<div className="position-absolute">
I am the position absolute text.
</div>
</div>
)
}
});
ReactDOM.render(<TourGuide />, document.getElementById('__react-content'));
Test Case
npm test
npm run chrome-test
Coverage
npm run coverage
open coverage/ dir
License
rc-tour-guide is released under the MIT license.