0.1.2 • Published 3 years ago
reactive-widget v0.1.2
reactive-widget
A library for creating fast and reactive web components.
Getting Started
Installation:
run
$ npm install reactive-widget
.Creating your first widget:
import { Widget, html, css } from 'reactive-widget'; class MyWidget extends Widget { static get styles() { return [ css` span { color: green; } `; ] } initializeAttributes() { super.initializeAttributes(); this.greetText = "Hello World!"; } get template() { return html`<h1>${this.text}</h1>`; } } MyWidget.createAttributes({ greetText: String }); MyWidget.createReactiveProperties(["greetText"]); MyWidget.register();
<my-widget reactive-attribute="Woohoo!"></my-widget>