Coming from htmx

Same idea.
Far fewer parts.

Minu covers the common htmx workflow in about 4 KB. Most pages move by renaming attributes. A few things — history, extension hooks, attribute inheritance — are deliberately absent, and saying so is the point.

The short version

Rename the prefix. Everything else works the same unless the table below says otherwise.

<!-- htmx -->
<button hx-get="/cart" hx-target="#cart" hx-swap="innerHTML">Refresh</button>

<!-- minu -->
<button minu-get="/cart" minu-target="#cart" minu-swap="innerHTML">Refresh</button>

Form posts, polling, OOB updates, and SSE map the same way:

<form hx-post="/save" hx-target="#result">
<form minu-post="/save" minu-target="#result">

<div hx-get="/price" hx-trigger="every 5s">
<div minu-get="/price" minu-trigger="every 5s">

Trigger defaults line up too: forms submit, buttons click, and form fields fire on change, so renamed markup behaves the same before you add a single trigger.

Attribute map

htmx 2.x names are shown; htmx 4 renamed a few attributes in its own upgrade guide. The Minu side is stable.

htmxMinuNotes
hx-get hx-post hx-put hx-patch hx-deleteminu-get minu-post minu-put minu-patch minu-deleteSame verbs.
hx-targetminu-targetthis is supported.
hx-swapminu-swapNo swap:, settle:, or transition: modifiers.
hx-triggerminu-triggerOne event per element. Modifiers below.
hx-valsminu-valsJSON object; no js: prefix.
hx-includeminu-includeSelector or comma-separated selectors.
hx-headersminu-headersJSON object.
hx-indicatorminu-indicatorAdds minu-requesting during the request.
hx-disabled-eltminu-disableSelector, self, or this.
hx-confirmminu-confirmNative confirm().
hx-selectminu-selectExtract before swapping.
hx-swap-oobminu-oobDefault is outerHTML on the selector.
sse-connect + sse-swapminu-sse + minu-sse-eventSSE is built in, not an extension.
hx-boost, hx-push-url, hx-replace-url—No history layer. Keep server routes.
hx-ext, hx-on—Use normal event listeners and browser APIs.
hx-inherit, hx-disinherit—Minu never inherited, so nothing to undo.

Triggers

The modifier grammar carries over. A comma-separated trigger list does not — put each event on its own element, or use from: to watch another element.

Defaults follow the element, like htmx: a <form> submits, a <button> clicks, and form fields fire on change. One deliberate difference: other elements — a <div>, a section — load immediately on init instead of waiting for a click.

htmxMinu
hx-trigger="click"minu-trigger="click"
hx-trigger="every 5s"minu-trigger="every 5s"
hx-trigger="revealed"minu-trigger="revealed"
hx-trigger="keyup changed delay:300ms"minu-trigger="keyup changed delay:300ms"
hx-trigger="click from:#other"minu-trigger="click from:#other"
hx-trigger="click, keyup"Not supported. Split the element.

once, changed, delay:, throttle:, from:, load, and intersect all work. Polling pauses while the tab is hidden.

Swap modes

Minu ships the eight modes most apps use: innerHTML, outerHTML, beforebegin, afterbegin, beforeend, afterend, delete, and none.

Morphing is not in the core. It is a 0.9 KB plugin:

import minu from 'minu';
import morph from 'minu/morph';

minu.registerSwap('morph', morph);
minu.init();

Then use it like any other mode:

<div minu-get="/inbox" minu-trigger="every 10s" minu-swap="morph">
    <input name="reply">
</div>

Events

Minu emits minu: events on the element and they bubble. htmx 4’s renamed htmx:phase:action events have no direct equivalent for every phase; these are the useful pairs.

htmxMinu
htmx:beforeRequest / htmx:before:requestminu:beforeRequest (cancelable)
htmx:afterRequest / htmx:after:requestminu:afterRequest
htmx:afterSwap / htmx:after:swapminu:contentLoaded
htmx:responseError / htmx:response:errorminu:contentError
htmx:sseMessageminu:sseMessage
document.addEventListener('minu:contentLoaded', (event) => {
    console.log(event.detail.url);
});

What is deliberately missing

Migration checklist

  1. Load Minu with a script tag or npm, then call minu.init().
  2. Rename hx- to minu-; move any inherited target or swap down to the requesting element.
  3. Split comma-separated triggers; keep the modifier grammar.
  4. Replace event listeners with the minu: names above.
  5. Delete boost, history, and extension code. Add minu/morph only where a swap must preserve DOM state.
  6. Run the page and check the network panel; Minu logs invalid selectors and JSON instead of failing silently.
API reference Project overview Source