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-boost or response headers like HX-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 features and jsKjs support
htmxjsKjsNotes
hx-get / hx-post / hx-put / hx-patch / hx-delete✓ Yeskj-get … kj-delete. Urlencoded bodies; multipart when a form has file inputs.
hx-target (CSS selector)✓ Yeskj-target. Extended targets (this, closest, next, previous, find) are not supported.
hx-swap: innerHTML, outerHTML, beforebegin, afterbegin, beforeend, afterend, none✓ Yeskj-swap, plus textContent. No delete swap.
hx-swap modifiers (swap:, settle:, scroll:, show:, transition:)✗ No
hx-trigger: events, delay:, load, revealed, every Ns✓ Yeskj-trigger.
hx-trigger: multiple events, changed, once, throttle:, from:, intersect, filters✗ No
hx-confirm✓ Yeskj-confirm (native confirm dialog).
hx-indicator◐ Partialkj-indicator shows/hides the element; no htmx-request class. aria-busy is set automatically.
hx-include / hx-vals◐ Partialkj-include (selector) and kj-vals (JSON). No js: values.
hx-push-url◐ Partialkj-push-url; no history cache or automatic restore.
Lifecycle events◐ Partialkj:before, kj:after, kj:error, kj:load — not cancelable.
hx-select, hx-select-oob, hx-swap-oob✗ NoUse .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◐ PartialSends 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✓ YesMutationObserver; 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">

See every Hyper feature live →