@shgysk8zer0/aegis-component

0.0.4 • Public • Published

@shgysk8zer0/aegis-component

Base component using @shgysk8zer0/aegis & @shgysk8zer0/aegis-styles.

CodeQL Node CI Lint Code Base

GitHub license GitHub last commit GitHub release GitHub Sponsors

npm node-current npm bundle size gzipped npm

GitHub followers GitHub forks GitHub stars Twitter Follow

Donate using Liberapay


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');

Package Sidebar

Install

npm i @shgysk8zer0/aegis-component

Weekly Downloads

0

Version

0.0.4

License

MIT

Unpacked Size

46.9 kB

Total Files

11

Last publish

Collaborators

  • shgysk8zer0