abstract-element
AbstractElement aims for creating Web components identically independent from a render engines. This project has an abstract class and a set of basic methods for developing Web components using various render engines.
+---------------------------------------+
| |
| AbstractElement + render-function |
| |
+---------------------------------------+
| | |
| Web components | Renders |
+---------------------------------------+
| | |
| Custom Elements | lit-html |
| | |
| Shadow DOM | hyperHTML |
| | |
| ES Modules | ... |
| | |
| HTML Template | |
| | |
+---------------------------------------+
Getting started
-
Add abstract-element to your project:
npm i abstract-element
-
Install a render engine*.
-
Create an element by extending AbstractElement and calling
customElements.define
with your class or use@Define
directive if you use TypeScript.
;; ; /** * The demo web component with lit-html render engine */
- Use the Web component.
Demo
- See the demo files for more examples.