Evolution-based components with Custom Elements v1 implementation.
npm install @dnajs/custom-elements-v1
Evolution-based components.
Documentation | Issue tracker | Project home page | Author home page

```
$ npm i @dnajs/custom-elements-v1 --save
DNA is built on the top of Custom Elements v1 specs, so it is 100% compatible with the CustomElementsRegistry interface. Simply define the component and register it using customElements.define:`js
import { prop, BaseComponent, IDOM } from '@dnajs/custom-elements-v1';
class MyElem extends BaseComponent {
static get observedAttributes() {
return ['message']
}
get properties() {
return {
helloMessage: prop.STRING.attribute('message'),
};
}
get template() {
return IDOM.h('span', this.helloMessage);
}
connectedCallback() {
super.connectedCallback();
this.helloMessage = 'Hi!';
}
}
customElements.define('my-elem', MyElem);
// RENDER
document.body.appendChild(new MyElem());
``html``
Hi!
More:
* JSX support
* native support