Giter Club home page Giter Club logo

user-experience-builder-divwrapper-library's Introduction

ShellShow-Onboard-Builder-DivWrapper

With this library, you can create exceptional user onboarding experiences for any webpage of your website. Simply integrate the library with the Webpage Component where you want to show. You can create different onboarding experiences for each webpage to make the user comfortable with your website features.

Setup In React Project

  1. Import the library in your main component, where you want to display the User Onboard Templates.
  • dataLoader -> This function is used to load all templates from a group in project.
  • showTemplate -> This function is used to start the onboarding experience for a webpage.
import { dataLoader, showTemplate } from "shellshow-onboard-builder-div-wrapper";
  1. Execute the dataLoader() function inside the ComponentDidMount lifecycle in class based component, or useEffect hook in react hooks. You also need to pass the group Id, whose templates you want to show. You need to copy the groupId from the ShellShow's website, where you have created all your templates.

An example with react hooks is given below: We call a function "loadTemplates()" in our useEffect,to execute the dataLoader() function with async await feature. Once we receive the templates, we save it in react hooks state variable for using the templates in our website.

var [templates, setTemplates] = useState([]);

  const loadTemplates = async () => {
    const response = await dataLoader("5f09bba96362545b5c71eb17"); // wait till templates are fetched
    setTemplates(response); // we store fetched templated in templates hook variable
  };
  useEffect(() => {
    loadTemplates();
  }, []);
  1. After this, bind any button(which user can click) with the showTemplates() function to start showing the templates. You need to pass the Javascript "document" object and the fetched templates for this function to work. In the below code, we call a startTour() function when we click the button, which ultimately executes the showTemplate() function.
  const startTour = async (event) => {
    event.preventDefault();
    showTemplate(document, templates);
  };
  <button
        onClick={(e) => startTour(event)}
      >
        Start Tour
  </button>

Setup In Vue Project

  1. Import the library in your main component, where you want to display the User Onboard Templates.
  • dataLoader -> This function is used to load all templates from a group in project.
  • showTemplate -> This function is used to start the onboarding experience for a webpage.
import { dataLoader, showTemplate } from "shellshow-onboard-builder-div-wrapper";
  1. Execute the dataLoader() function when the Vue Component has mounted. You also need to pass the group Id, whose templates you want to show.

An example is given below: We call a function dataLoader() inside the async mounted() function of Vue Component. Once we receive the templates, we save it in Vue state variable for using the templates in our website.

export default {
data() {
    return {
      templates: []
    };
  },

async mounted() {
    const response = await dataLoader("5f09bba96362545b5c71eb17");
    this.templates = response;
  }
};
  1. After this, bind any button(which user can click) with the showTemplates() function to start showing the templates. You need to pass the Javascript "document" object and the fetched templates for this function to work. In the below code, we call a startTour() function when we click the button, which ultimately executes the showTemplate() function.
 <button
      v-on:click="startTour()"
    >Start Show</button>
export default {

 methods: {
   startTour() {
     showTemplate(document, this.templates);
   }
 };
};

user-experience-builder-divwrapper-library's People

Contributors

sss41097 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.