0.0.3 • Published 3 years ago

react-user-onboarding v0.0.3

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

react-user-onboarding

✨ A React Component library for User Onboarding (guided tour or explanation walkthrough) on your web application to increase usage and reduce churn rate of users upon first interaction.

Version Documentation Maintenance License: MIT Twitter: johndamilola

Demo | Documentation | Issues

Install

npm install react-user-onboarding
yarn add react-user-onboarding

Usage

import React, { Component } from 'react'

import UserOnboarding from 'react-user-onboarding'
import 'react-user-onboarding/dist/index.css'

const tooltip1 = useRef();
const story = [
  {
    component: 'modal',
    intro: true,
    children: (
      // Html component for initial modal goes here
    )
  },
  {
    component: 'tooltip',
    ref: tooltip1,
    children: (
      // Html component for tooltip goes here
    )
  },
  {
    component: 'speech-bubble',
    children: (
      // Html component for speech-bubble goes here
    )
  },
  {
    component: 'modal',
    intro: false,
    children: (
      // Html component for last modal goes here
    )
  }
]

const Example = () => {
  return (
    <div>
      <UserOnboarding 
        story={story} 
        isVisible={isVisible}
        onClose={() => setIsVisible(false)} 
      />
    </div>
  )
}

UserOnboarding API

NameDescriptionTypeDefault
storythe story object for the onboarding flowarray[object](https://johndamilola.github.io/react-user-onboarding#story-object)
isVisiblevalue used to toggle the component's visibilitybooleanfalse
initialPositionvalue used to jump to a specific story pointnumber0
onClosefunction to close the componentfunction

Story Object

NameDescriptionTypeComponent
componentindicate the type of component (modal, tooltip, speech-bubble)stringmodal, tooltip, speech-bubble
introvalue to indicate the first onboarding stepbooleanmodal
refref to store the target node for the tooltipReact Reftooltip
childrenthe html content of the modals, tooltips and speech bubbleReactNodemodal, tooltip
classNamea css class name to style the modals, tooltips and speech bubblestringmodal, tooltip, speech-bubble

Modal Object Example

    {
        component: 'modal',
        intro: true,
        children: (<div>modal content goes here</div>)
    }

Tooltip Object Example

    {
        component: 'tooltip',
        ref: loginFormRef,
        children: (<div>tooltip content goes here</div>)
    }

Speech Bubble Object Example

    {
        component: 'speech-bubble',
        ref: loginFormRef,
        children: (<div>tooltip content goes here</div>)
    }

Author

👤 John Damilola (made with ❤️)

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2020 John Damilola.

This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator