v1.6.1 · 4.0 KB gzip · zero runtime deps

HTML fragments,
not a framework.

Minu fetches server-rendered HTML and puts it where it belongs. Forms, polling, out-of-band updates, and SSE — without a SPA, a router, or a build step.

npm install minu
live demo

Auto-loaded fragment

Loading fragment…

This card was fetched from demo-price.html by Minu. It is not hard-coded into this page.

0runtime dependencies
4.0 KBminified + gzipped
18tests passing
1small core

Quick start

Three attributes and a script tag.

No bundler required. Load the UMD build from npm/unpkg, or import the ESM build from a bundler.

<script src="https://cdn.jsdelivr.net/npm/minu@1.6.1/dist/minu.min.js"></script>

<div minu-get="/widgets/price"
     minu-trigger="load"
     minu-target="#price">
    <div minu-content>Loading…</div>
</div>

<div id="price"></div>

<script>minu.init();</script>
01
Server keeps rendering HTML.

Minu swaps the response into the target. No JSON schema, no client templates.

02
One attribute drives the request.

minu-get, minu-post, and the other verbs. Forms serialize automatically.

03
Events are normal DOM events.

Listen with addEventListener. Everything bubbles and is cancelable where it matters.

What is inside

Small surface. Real applications.

↯

Every HTTP verb

GET, POST, PUT, PATCH, DELETE. Forms, files, headers, values, timeout, and credentials.

◷

Trigger grammar

every 5s, revealed, intersect, once, changed, debounce, throttle, and from:.

⇄

Eight swap modes

innerHTML, outerHTML, before/after positions, delete, and none.

◈

One response, many regions

minu-oob updates carts, toasts, and counters from a single HTML payload.

≈

Live SSE content

Native EventSource with reconnect, named events, OOB updates, and one-connection fan-out.

⌁

Server protocol

Minu-Trigger, Minu-Redirect, and Minu-Refresh let the server steer the client.

Try it here

Click a tab. Watch the fragment load.

This is a real Minu instance on this page, fetching static fragments from this GitHub Pages site. The same code runs against dynamic endpoints locally.

Pick a tab to fetch its fragment.

Runnable gallery

One page for every scenario.

The repository ships 12 self-contained examples. Each card opens a separate page; the dynamic responses are simulated on Pages and real when you run npm run examples locally.

Every example above is a separate page. GitHub Pages is static, so the dynamic scenarios (form, polling, SSE, OOB, search, events) use a small browser-side adapter. Run npm run examples for the real Node server.

Positioning

A deliberate small tool.

Minu is for Rails, Django, Laravel, PHP, and Express apps that already render HTML. It is not a router, a state manager, or a template language. It is the smallest useful bridge between a server-rendered page and a fragment request.

  • Bring htmx-style attributes; skip the extension system.
  • Bring Turbo-style live updates; skip the SPA frame model.
  • Bring Unpoly-style server protocol; skip the history layer.