A collection of useful widgets.
To use widgets in browser, please follow instruction below:
- Add the
script
tag in your web as below.
<script src="https://gitcdn.xyz/repo/greytip/summon-widgets/master/build/summon-widgets.js"></script>
- After including widgets, we need to register them to browser using
customElements.define
api. eg. a progress bar can be registered as
customElements.define('my-progress-bar', SummonWidgets.ProgressBar);
- Once you register a widget, it's available as an
HTMLElement
.
<!-- Our custom progress bar. -->
<my-progress-bar job-id="12345" source="some/source/to/get/status"></my-progress-bar>
Note: Widgets will only be accessible by the name used for registration.
Fetches status and displays it.
job-id
: Id of the job whose status needs to displayed.source
: Source which takes the job-id and returns the status. Source should have a placeholder for job. eg.get/{job-id}/status
.{job-id}
is a placeholder for the job.
- Clone the repository.
- Navgite to repo and Run
npm install
to get dependecies. - Run
npm run server
to start a local server. - Hit
http://localhost:4000
in the browser. - To create build run
npm run build
.