@shgysk8zer0/aegis-component
v0.0.4
Published
Base component using `@shgysk8zer0/aegis` & `@shgysk8zer0/aegis-styles`
Downloads
5
Maintainers
Readme
@shgysk8zer0/aegis-component
Base component using @shgysk8zer0/aegis
& @shgysk8zer0/aegis-styles
.
Example Component
import { AegisComponent, TRIGGERS, SYMBOLS } from '@shgysk8zer0/aegis-component';
import { html, css, appendTo, addStyles } from '@shgysk8zer0/aegis';
export class HTMLHelloWorldElement extends AegisComponent {
[SYMBOLS.render](type, { shadow }) {
switch(type) {
case TRIGGERS.constructed:
appendTo(shadow, html`<h1 class="foo">Hello, World!</h1>`);
addStyles(shadow, css`
.foo {
color: red;
}
`);
break;
}
}
}
HTMLHelloWorldElement.register('hello-world');