Signal Counter

A reactive instrument wired straight to the DOM.

Server-rendered Shadow DOM hydrated by a custom element. Tiny signals bind a value, its derived readings, and a history feed to the panel — no virtual DOM, no compiler, no client render pass.

Runtime
Cloudflare Worker
UI
Custom Element
Build
None

What it demonstrates

A click updates one small signal store. The value, its doubled, parity and distance derivations, the gauge, button states and the history feed all recompute and patch their own nodes — only the parts that changed.

Hydration path

The Worker emits the element with declarative Shadow DOM. In the browser, the Native Fragments helper adopts that exact shadow root, then attaches listeners and subscriptions — so first paint and interactive markup are identical.