Compare · Hyper · htmx-style
jsKjs vs htmx
Hyper borrows htmx's best idea — let HTML describe requests and let the server return HTML — and implements the attributes most pages use. Rename hx- to kj- for the basics.
Choose jsKjs when…
- Your hypermedia needs are the common ones: load, submit, search, poll, lazy-load, delete.
- You also want a jQuery API, client-side state and animation in the same tiny file.
Choose htmx when…
- You need out-of-band swaps,
hx-select,hx-boostor response headers likeHX-Trigger/HX-Redirect. - You use extensions: SSE, WebSockets, idiomorph, preload.
- You need request coordination (
hx-sync) or rich trigger modifiers.
Feature by feature
Compared with htmx 2.0.11. ✓ works the same · ◐ supported with differences · ✗ not included.
| htmx | jsKjs | Notes |
|---|---|---|
| hx-get / hx-post / hx-put / hx-patch / hx-delete | ✓ Yes | kj-get … kj-delete. Urlencoded bodies; multipart when a form has file inputs. |
| hx-target (CSS selector) | ✓ Yes | kj-target. Extended targets (this, closest, next, previous, find) are not supported. |
| hx-swap: innerHTML, outerHTML, beforebegin, afterbegin, beforeend, afterend, none | ✓ Yes | kj-swap, plus textContent. No delete swap. |
| hx-swap modifiers (swap:, settle:, scroll:, show:, transition:) | ✗ No | |
| hx-trigger: events, delay:, load, revealed, every Ns | ✓ Yes | kj-trigger. |
| hx-trigger: multiple events, changed, once, throttle:, from:, intersect, filters | ✗ No | |
| hx-confirm | ✓ Yes | kj-confirm (native confirm dialog). |
| hx-indicator | ◐ Partial | kj-indicator shows/hides the element; no htmx-request class. aria-busy is set automatically. |
| hx-include / hx-vals | ◐ Partial | kj-include (selector) and kj-vals (JSON). No js: values. |
| hx-push-url | ◐ Partial | kj-push-url; no history cache or automatic restore. |
| Lifecycle events | ◐ Partial | kj:before, kj:after, kj:error, kj:load — not cancelable. |
| hx-select, hx-select-oob, hx-swap-oob | ✗ No | Use .load("url #fragment") for fragment selection. |
| hx-boost, hx-replace-url, hx-history, hx-history-elt | ✗ No | |
| hx-headers, hx-params, hx-encoding, hx-request, hx-sync, hx-disabled-elt, hx-prompt, hx-preserve, hx-on, hx-ext | ✗ No | |
| Request header | ◐ Partial | Sends X-Requested-With: jsKjs (not HX-Request / HX-Target). |
| Response headers (HX-Trigger, HX-Redirect, HX-Retarget, HX-Reswap…) | ✗ No | |
| Extensions: SSE, WebSockets, morphing, preload | ✗ No | |
| Auto-wiring of new content | ✓ Yes | MutationObserver; polling stops when its element is removed. |
Same page, renamed
HTML
<!-- htmx -->
<input name="q" hx-get="/search" hx-trigger="keyup delay:300ms" hx-target="#results">
<!-- jsKjs -->
<input name="q" kj-get="/search" kj-trigger="keyup delay:300ms" kj-target="#results">