Back to browse
GitHub Repository

simple reactive javascript for html

20 starsTypeScript

Tired of BIG JavaScript frameworks? try this

by aggroot·Feb 21, 2026·2 points·1 comment

AI Analysis

●●●BangerBig BrainNiche Gem

HTMX-native state layer: reactive contexts spread across multiple DOM fragments, no VDom.

Strengths
  • Multi-location context fragments solve real coordination pain in hypermedia apps without prop drilling
  • Tiny footprint (4.8KB gzipped) with zero runtime dependencies and full TypeScript support
  • Clean declarative syntax embedded in HTML attributes; aligns with HTMX/hypermedia philosophy
Weaknesses
  • Niche audience—only appeals to developers already bought into hypermedia-first architecture
  • No comparison benchmarks against HTMX+Shoelace, Alpine.js, or htmx extensions
  • Early maturity (6 stars) with no visible production usage or ecosystem
Target Audience

HTMX users, hypermedia developers, server-side rendering advocates

Similar To

Alpine.js · Shoelace · HTMX

Post Description

I wrote a tiny 5kb library with a new concept for client-side interactivity: reactive hypermedia contexts embedded in HTML.

It looks like this:

<div hctx="counter"> <span hc-effect="render on hc:statechanged">0</span> <button hc-action="increment on click">+1</button> </div>

It comes with reactive state, stores, and allows you to build your own DSL in HTML.

One feature that stands out is the ability to spread a single context scope across different DOM locations:

<!-- Header --> <nav> <div hctx="cart"> <span hc-effect="renderCount on hc:statechanged">0 items</span> </div>

</nav>

<!-- Product listing -->

<div hctx="cart">

<button hc-action="addItem on click">Add to Cart</button>

</div>

<!-- Sidebar -->

<div hctx="cart">

<ul hc-effect="listItems on hc:statechanged"></ul>

</div>

Contexts are implemented via a minimal API, and TypeScript is fully supported.

Curious what you think, feedback is welcomed.

Similar Projects