1.0.0 • Published 5 years ago

ui-preloader v1.0.0

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

Ui-Preloader is a simple vanilla js component for simple messages in the browser.

Install / Import

via npm

Install the package

npm i ui-preloader --save
import { init as UiPreloaderInit } from 'ui-preloader';

via script

Download the file ui-preloader.js in the js/dist/ folder and place it into your html file.

...
<body>

  ...
  <script src="ui-prelader.js"></script>
  <script>
    // use here
  </script>

</body>

API

To create a preloader component you just need to call the init function. The first argument is the root. It´s the container where the component gets inserted. Root is by default the body element.

init(root <HTML Element>)

  const myPreloader = init(document.querySelector('.container'));

close() Once you create an inheritance and the preloader is not needed anymore you can just call the destroy method to remove it from the dom.

 myPreloader.close()