HACKER Q&A
📣 vyrotek

Are You Using Htmx?


https://htmx.org

"htmx gives you access to AJAX, CSS Transitions, WebSockets and Server Sent Events directly in HTML, using attributes, so you can build modern user interfaces with the simplicity and power of hypertext."

I'd like to hear experiences folks have had with using HTMX. I see a lot of great comments about it online. Is there anything holding it back from larger adoption?


  👤 recursivedoubts Accepted Answer ✓
> Is there anything holding it back from larger adoption?

I'm the creator of htmx. A few things:

* it isn't from and supported by a big tech company like google or facebook

* it is idiosyncratic, using hypermedia rather than the more popular RPC/reactive approach of most front end libraries

* there are very few job postings mentioning it, and most folks, for obvious and valid reasons, want to learn libraries that are relevant for jobs

I'm very happy w/ how much traction it's gotten though, and I expect it will keep growing in the future. I doubt it will ever be anywhere near the big front end libraries, but if it's a small, stable tool that makes things better for some people, that's good enough for me.


👤 leephillips
It’s great. If you have a static site with no javascript and you want to add some interactivity or replace some reloads with some ajax interactions, html makes it easy to sprinkle this in without having to rewrite the whole thing. It’s very small and efficient, and easy to work with.

> Is there anything holding it back from larger adoption?

I don’t know or care. If I were the only one in the world using it, it would make no difference. It’s self-contained and trivial to self host.


👤 lucapanof
I used to write most of my front-end applications in clojurescript with reagent + reframe.

I really love the reframe way to write react components and for this very reason I really never considered other alternatives until I discovered htmx.

Working with htmx in clojure is really fun. In reagent I used to write hiccup, handlers and state code. Now I just write hiccup and instead of writing handlers and state code I rely on the htmx attributes and hyperscript when necessary - maybe beacause of backend constraints or else.

Finally, I extended hyperscript conversion to let it parse js hiccup. That really made my day. It's really powerful.

Overall, only positive feedbacks from my relatively small experience.


👤 PaulHoule
I am using it. It is good for dropdowns that immediately send a state change to the server as soon as you change them. It is also good for a classification process where you might make several judgements about a document in a structured way and the back end can replace the judgement buttons with different buttons depending on what you chose the first time, then finally reload the whole thing and move to the next document.

👤 yawaramin
I'm using it for a personal project and for a couple of different company-internal projects at work. My personal project is making more complex use of it, with different (server-rendered) components. Like with anything else, you need to keep a handle on complexity with many different components rendering different parts of the page. On the whole though it works really well. The internal apps at work are benefitting from it because I get exactly the interactions I need (confirmation of some action, async requests submission and page update) with extremely minimal footprint, just a small snippet of custom JS and CSS.

👤 vyrotek
Here are some interviews with the creator, Carson Gross.

https://www.dotnetrocks.com/details/1749

https://changelog.com/gotime/266


👤 leros
I only know of one company using HTMX and they're currently rewriting their apps in React. Solo projects are obviously one thing, but in a company you want to use popular technology to make hiring easier.

👤 leke
I've used it for the first time in an application with a lot of dynamic form situations. I generally update the "main" tag which appears to speed up the performance.

👤 mejutoco
I do use it with django. I make sure to create a data structure with all the htmx ids to ma sure I can find all the places that update an element. Otherwise it gets messy.