Tiny·Engine (Core)
interactive

Playground

tiny-engine-core works great in local npm-based sandboxes. Pick your favourite starter, paste the snippet from Quick Start, and you're live.

Local starter

Create a local npm project and run this in src/main.ts.

index.html
<!DOCTYPE html>
<html>
  <body>
    <button ui-counter>
      Clicked <span ref="label">0</span> times
    </button>
    <script type="module">
      import { UI, Capsule } from "https://unpkg.com/tiny-engine-core";
      class Counter extends Capsule {
        constructor(el, options) {
          super(el, options);
          let count = 0;
          this.on(this.el, "click", () => { count++; this.refs.label.textContent = count; });
        }
      }
      UI.register("counter", Counter);
      UI.init();
    </script>
  </body>
</html>