Description
Is easy, animated, a lot of functionality, flexible, step tutorial for your site.
Install
npm install --save react-site-tutorial
Install example
- In root folder
npm install
- In example folder
npm install
- In root folder
npm start
- In example folder
npm start
Connect tutorial to App
import React from "react";import ReactDOM from "react-dom";import SiteTutorial from "react-site-tutorial"; ReactDOM;
Tutorial Block
It's blocks which will show in your tutorial.
import React Component from "react";import TutorialBlock from "react-site-tutorial"; { return <div> <TutorialBlock ="Title 1" ="Text" = => <div /> </TutorialBlock> <TutorialBlock ="Title 2" ="Text" = => <div /> </TutorialBlock> </div> ; }
Props | Type | Required | Description |
---|---|---|---|
numTutorial |
number | yes |
Number tutorial. You can create more then one tutorial in your App. |
step |
number | yes |
Step indicates the order of tutorial. |
title |
string | no |
This props will show in your Popup like Title. (see bottom) |
text |
string | no |
This props will show in your Popup like Text. (see bottom) |
onFinish |
function | no |
Callback after finish animation step. |
onAsyncFinish |
function | no |
See bottom. |
Tutorial Start
The button that starts the tutorial.
import React from "react";import TutorialStart from "react-site-tutorial"; const Component = <TutorialStart =>FIRST TEST</TutorialStart>;
Props | Type | Required | Description |
---|---|---|---|
numTutorial |
number | yes |
Property indicates which tutorial will starts. |
Default Popup
Tutorial has default popup which you can easy styling.
import React from "react";import ReactDOM from "react-dom";import SiteTutorial from "react-site-tutorial"; ReactDOM;
Props | Type | Description |
---|---|---|
numTutorial |
object | Accept color , width , hieght , properties. |
Custom Popup
You can easily create custom popup. Just add <SiteTutorial customPopup={true}>
prop and create on one level lower <SiteTutorial>
your custom popup.
import React from "react"; import TutorialPopup TutorialNext TutorialBack TutorialStop TutorialProgressBar TutorialDescription TutorialTitle from "react-site-tutorial"; const CustomTutorialPopup = <TutorialPopup ="tutorial-popup"> <h1>This is custom popup!</h1> <TutorialTitle ="tutorial-title"/> <TutorialDescription ="tutorial-description"/> <TutorialNext ="tutorial-button-next">Next</TutorialNext> <TutorialBack ="tutorial-button-prev">Prev</TutorialBack> <TutorialStop ="tutorial-button-stop">Stop</TutorialStop> <TutorialProgressBar =/> </TutorialPopup>; ;
import React from "react";import ReactDOM from "react-dom";import SiteTutorial from "react-site-tutorial"; import CustomTutorialPopup from "./path/to/CustomTutorialPopup"; ReactDOM;
Components | Props | Description |
---|---|---|
<TutorialTitle> |
className , id |
Here will be title which you indicate in <TutorialBlock> . |
<TutorialDescription> |
className , id |
Here will be description which you indicate in <TutorialBlock> . |
<TutorialNext> |
className , id |
This is button which move step forward. |
<TutorialBack> |
className , id |
This is button which move step back. |
<TutorialStop> |
className , id |
This is button which stop tutorial. |
<TutorialProgressBar> |
className , id |
Animated will display the step tutorial. (see bottom) |
Tutorial Progress Bar
Props | Default value | Type | Description |
---|---|---|---|
showStep |
false |
boolean | Show of current step and all steps. |
color |
red |
string | Set common color popup. |
About Codica
The names and logos for Codica are trademarks of Codica.
We love open source software! See our other projects or hire us to design, develop, and grow your product.