/web-components

Primary LanguageJavaScriptMIT LicenseMIT

Web Components

Here is my experimentation with Custom Elements and Shadow DOM, aka Web Components.

You will be able to see different examples of Web Components, which are built using only Custom Elements and Shadow DOM, using a very simple framework to make easier the work.

This framework is simply a Component (a EcmaScript 6 Class) that inherits from HTMLElement and that provide some useful methods so that we can construct new components easily and quickly. The Component has some functionalities that may seem similar to React, such as the setState() and render() methods, which work in conjunction to handle the state and build the markup of our components.

This small framework uses as many Custom Elements features as possible without any unnecessary modification or abstraction, so if you need more documentation than I will provide in this repository, you can refer to the official documentation of Custom Elements and Shadow DOM.

Enjoy.