htmx is only one of many different libraries & frameworks that take the hypermedia oriented approach to building web applications. I have said before that I think the ideas of htmx / hypermedia are more important than htmx as an implementation.
Here are some of my favorite other takes on these ideas that I think are worth your consideration:
Unpoly is a wonderful, mature front end framework that has been used heavily (especially in the ruby community) for over a decade now. It offers best-in-class progressive enhancement and has many useful concepts such as layers and sophisticated form validation.
I interviewed the author, Henning Koch, here
You can see a demo application using Unpoly here.
Datastar started life as a proposed rewrite of htmx in typescript and with modern tooling. It eventually became its own project and takes an SSE-oriented approach to hypermedia.
Datastar combines functionality found in both htmx and Alpine.js into a single, tidy package that is smaller than htmx.
You can see many examples of Datastar in action here.
Speaking of Alpine (which is a common library to use in conjunction with htmx) you should look at Alpine AJAX, an Alpine plugin which integrates htmx-like concepts directly into Alpine.
If you are already and Alpine enthusiast, Alpine AJAX allows you to stay in that world.
You can see many examples of Alpine AJAX in action here.
Turbo is a component of the Hotwire set of web development technologies by 37Signals, of Ruby on Rails fame. It is a polished front end framework that is used heavily in the rails community, but can be used with other backend technologies as well.
Some people who have had a bad experience with htmx have enjoyed turbo.
htmz is a brilliant, tiny library that takes advantage of the fact that anchors and forms
already have a target
attribute that can target
an iframe
.
This, in combination with the location hash
, is used to allow generalized transclusion.
This is the entire source of the library (I’m not joking):
<iframe hidden name=htmz onload="setTimeout(()=>document.querySelector(contentWindow.location.hash||null)?.replaceWith(...contentDocument.body.childNodes))"></iframe>
Amazing!
TwinSpark is a library created by Alexander Solovyov that is similar to htmx, and includes features such as morphing.
It is being used in production on sites with 100k+ daily users.
Finally, good ol’ jQuery has the the load()
function that will load a given url into an element. This method was part of the inspiration for
intercooler.js, the precursor to htmx.
It is very simple to use:
$( "#result" ).load( "ajax/test.html" );
and might be enough for your needs if you are already using jQuery.
I hope that if htmx isn’t right for your application, one of these other libraries might be useful in allowing you to utilize the hypermedia model. There is a lot of exciting stuff happening in the hypermedia world right now, and these libraries each contribute to that.
Finally, if you have a moment, please give them (especially the newer ones) a star on Github: as an open source developer I know that Github stars are one of the best psychological boosts that help keep me going.