Skip to content

ManadayM/util-web-components

Repository files navigation

Built With Stencil

Utility Web Components 🛠

A collection of web components built for reusability and performance.

Components

We will gradually add useful components under this project. You can find detailed documentation for each component into its respective directory. Please click on a component's tag/name in the table below, it should take you to the READEME page of that respective component.

Sr. No. Tag Descritpion
1. uc-image Lazy load images on all browsers including IE11.

Package size

You don't need to worry about the package size as it will only download the components that you have used on your page. 🤩

Usage

This components collection is based on "differential bundling" strategy. The advantage of differential bundling is that modern browsers can avoid all the polyfills and bloated legacy JavaScript, and use the modern APIs already baked into the browser.

For example, the modern browsers will only download util-components.esm.js as they out-of-the-box support latest JavaScript features like ES Modules, async/await, Classes, etc. For IE11, it will download the util-components.js file which is in the ES5 syntax and has all the polyfills.

Script tag

  • Put script tags as shown above in the head of your web page.
  • Then you can use the custom elements anywhere in your template, JSX, html etc.

Unpkg CDN

<script type="module" src="https://unpkg.com/util-web-components/dist/util-components/util-components.esm.js"></script>
<script nomodule src="https://unpkg.com/util-web-components/dist/util-components/util-components.js"></script>

jsDelivr CDN

<script type="module" src="https://cdn.jsdelivr.net/npm/util-web-components/dist/util-components/util-components.esm.js"></script>
<script nomodule src="https://cdn.jsdelivr.net/npm/util-web-components/dist/util-components/util-components.js"></script>

Examples

Please check examples directory for a sample usage. You can locate an example for each component at examples/<component-tag>/index.html.