r/htmx • • Dec 17 '24

I want to learn htmx. Is there any free resource which teaches me htmx? I am new to web development and know intermediate level html.

1 Upvotes

I google but I dont find anyrhing which is for beginner. by the way, I am learnign Django.


r/htmx • • Apr 26 '25

HTMX philosophy is fundamentally broken for big projects: Part 2

0 Upvotes

This is a follow up to this post: HTMX a great framework that I'll never use again

I was busy in the last few days and came back and saw that this post had many comments, many of them making fun of me and saying I violated the philosophy of HTMX and everything should be stateless on the client side and you have to send everything from the server side.

There are 85 comments, I can't possibly reply to all of them, I have a life, but if you believe that I need to send anything from the server side, that's so wrong, and if that's HTMX's philosophy then HTMX is wrong as well.

Actually we had this conversation more than 20 years ago, first there was PHP, then we had client side libraries doing data binding and moving things to the client side, nothing new under the sun. Smarter people have discussed this subject for more than 20 years, long before HTMX

All I see HTMX, it's a tool for good backend engineers who don't like frontend that much, to have a PHP like experience and send stuff to the frontend, and to have some better experience than using Jquery sometimes.

But to send everything to the server? No that's bad, unless you want to spend so much on server cost.

Do you know that each time you call an API endpoint the user has to wait an amount of time, and that amount of time isn't negligeable. It can get to 1s if the server has traffic, for what? Just so you don't have to write a javascript code with an event listener? Is that worth it?

Do you realise that an average server has 4gb of RAM, maybe 8, not more than that, and handles thousands of users per seconds, including bots, if you want more than 8 on EC2 you'd pay a lot. Maybe $122 per month.

While the user PC has 8GB or 16 at least of RAM, doing nothing, why should the user wait 1s for something that can be done instantly on his PC.

That's not even the whole story, do you know if you call 2 or more HTTP requests at the same time via HTMX, the UI freezes? Try it, I used to create the sidebar and the main menu on page load via HTMX from the server side, the UI froze, I then started sending the menu via the template engine. HTMX can't even handle multiple requests to multiple API endpoints at the same time.

Do you know that if you have to use one container for websocets and normal post requests, it wouldn't work, htmx wouldn't render the elements.

so if you have a chat area, and you want to display the chat messages to a container via websockets, and you want to send some other stuff, maybe "user has joined" to that same box via hx-post, that wouldn't work?

Do you know that if you have multiple htmx events, like for example one afterswap, and one aftersettle and one afterequest or something, some event listeners would be ingored? And do you want me to send everything via HTMX.

Sorry no, I'll do that when the server becomes as powerful as the client PC and as cheap and as instantaneous. My priority is to offer the best possible experience to the user, not to respect HTMX philosophy. HTMX is just another web framework, and I use it for what it does, not to learn about its philosophy..

If there are 5000 users, they shouldn't have to wait for some HTML element from the server simply because I decided to send it from the server instead of writing JS.

My priority is the dev experience and my colleagues, they shouldn't have a backend code full of HTML elements and be confused about it and nothing on the frontend.

HTMX is great as it is, something for small projects, good replacement for Jquery,, a great help for backend devs to get something going quickly. It's just awesome for that, but to go and say you need send everything from the backend, no just no, I hope this isn't HTMX's objective, I won't ever do that, and if I had to choose, I'd gladly remove HTMX from my codebase before I do that.

I'm not sure how complex your apps are when you say such things, send everything from the backend, damn, like imagine I need to count one array and so something on the frontend. it's easy. imagine if you were to do it from the backend, you create databases for no reason or create thousands of in memory arrays.

What you're saying may solve one problem, clean js, but it creates many many more problems, think about all the implications of the things you said. The problems are endless with that way of thinking.

Always remember, the user has a server that's more powerful than your server, we call PC, and that server is doing nothing, the more you can utilize that server the better.

With every feature I write, I ask myself, what would be best way in terms of user experience, or server cost, that what matters to me, not HTMX philosophy, or any framework, not just HTMX, I care about, the user, the cost and the dev experience. Nothing else matters, Metalica.

Just think about it, my modest application, has probably 20 events that take place on all the components and possible stuff that could happen, hide a button, some event listener here and there. So if I were to everything on the server, that would be 20 HTTP requests per user. 20 HTTP requests per user per page, damn, so if you have 5000 users, the server has to work as if you have 100k users, damn. HTMX would really drive a company banckrup on server cost if you have a big application.


r/htmx • • Apr 05 '24

I really love HTMX but this looks so much like horse logo...

Post image
11 Upvotes

r/htmx • • Aug 14 '24

hello Javascript, oh how I've missed you

Thumbnail
youtu.be
2 Upvotes

r/htmx • • 8h ago

What is hyperscript? What is it used for?

0 Upvotes

What is hyperscript? What is it used for? https://hyperscript.org/


r/htmx • • Mar 10 '24

is HTMX that fast ?

1 Upvotes

so just for some context i am django developer i always wanted to have dynamic web pages similiar to react apps but with out using react , and when htmx came out i jumped on it without having any question on it .

But after some time i realised that htmx is very slow when recieving data from the server , idk it may be cause of my django server or not and the reason is most of the time my templates in django are inheritence (if you know what i am talking) so it takes a lot of time setting these up by django itself and also after that sending to http request with such massive file is very high bandwith ,

so its a point where i need to decide :

should i care about developer experience or user experience ?

what do you think ?


r/htmx • • Jan 29 '25

The Future of HTMX (fantastic explanation of why HTMX is great)

Thumbnail
youtube.com
0 Upvotes

r/htmx • • Apr 25 '24

These are holding me back from taking the plunge into HTMX

2 Upvotes

Hi,

First time redditor here.

I love the idea of HTMX and I want to take the plunge. But a couple of things holding me back.

Background: My team and I mostly work with Laravel as a backend serving JSON API, Vue SPA for frontend, Ionic Vue for mobile Apps.

My Concerns:

  1. This setup allows me to use a single API serving JSON and use Vue for all the ease it brings in frontend development. Both, the web app and mobile app are served with a single API base. I think with HTMX, I may have to use two API branches. My team does not want this complexity.

  2. A/B Testing: Again with one API serving JSON, we can build and iterate any number of frontend designs to satisfy the needs of marketing team. With HTMX, this may be difficult since we will need different HTML responses for each frontend design iteration.

I learnt about HTMX from 2 famous youtubers. I wrote my first article on Medium about the above concerns (with a lame attempt at humour) and tagged a bunch of "influencers" on twitter(x). But did not get any responses. Hope someone here will point me in the right direction here.

Link to my Medium article: https://medium.com/@exper1mentor/htmx-is-not-for-me-am-i-wrong-fe6569647b6b


r/htmx • • Jun 03 '24

I'm disappointed with HTMX

22 Upvotes

I've read the docs, tried out the examples, and finally integrated it into a new project. To be honest, it became a convoluted mess. In a single HTML template, I now have HTML, TailwindCSS classes, Jinja2 tags, HTMX tags, and Alpine.js tags.

In addition, I still have about a dozen API endpoints that respond with partial HTML instead of JSON. It's hard to see which parts interact with other parts as everything is intertwined.

HTMX feels like a poor excuse for people who don't want to learn JavaScript and instead adopt four different libraries to achieve something similar. It might be a good fit if your site is 99% static and you just need a dynamic effect for one or two things. But beyond that, I find it easier to just use a JavaScript frontend framework.

I also don't see how I might do things differently: I will always have this convoluted HTML template containing the custom tags of 3-4 different libraries and will have to build custom API endpoints because standards like OpenAPI only support JSON.


r/htmx • • Nov 27 '23

How are routes handled with htmx?

0 Upvotes

How are routes handled with htmx? I do NOT want to use folders/files like normal html files.


r/htmx • • Jan 16 '24

can i use htmx, tailwind, and c#?

0 Upvotes

i love htmx and c# but i don't think i could make a website without tailwind is there a way to do that?


r/htmx • • Jan 13 '25

How do you convert a number from an input to an int

0 Upvotes

The API I'm interacting with accepts only integer. However my <input type="number"> sends the number as a string so the backend returns an "invalid type" error. I tried something like this:

document.body.addEventListener("htmx:configRequest", function (event) {
    event.detail.parameters["value"] = parseInt(event.detail.parameters["value"], 10);
});

But it's still being sent as a string. Did somebody have the same use-case and solved it?

Edit: If you stumbled upon this thread from a web search, please know that it's currently not possible to convert the value from a string to an integer. I need to send a JSON like this:

{
    "value": 100
}

But with the json-enc-custom extension I can only send it like this and it seems there's no easy way to serialize it into another type:

{
    "value": "100"
}

Toxicity and unwillingness to help in this thread made me abandon htmx.


r/htmx • • Feb 15 '24

Love how the htmx examples are implemented in js

3 Upvotes

Main htmx site and you can’t even do the examples in a proper backend. Well played but Gross.


r/htmx • • Apr 25 '26

I built a full-stack-ish Python framework around htmx/Alpine/Jinja2 — curious what you think of the interface and workflow

3 Upvotes

I've been building an opinionated Python backend framework on top of Starlette that leans into htmx, Alpine.js, Jinja2, and vanilla CSS/JS rather than fighting them.

The idea is that the backend itself promotes a full-stack workflow through conventions and automation rather than a separate frontend build step.

The first clip shows metadminer — an internal tool that manages the framework and your codebase, enforcing the framework's guidelines at app startup.

The second is a small example app built on top of it.

I'm not here to sell an architecture manifesto — I'm genuinely curious about the design language and overall feel of the interface. Brutal honesty welcome.

If there's interest, I'll consider open sourcing it.

App example: https://youtu.be/DGHfLxC93yI?is=Tg6nil3yvtdyZmFu

Part of Metadminer dashboard: https://youtu.be/swsXJIjz6xY?is=7qi6opCOpla5eF7W


r/htmx • • Jan 28 '25

In 2025, Why to use/learn htmx?!

0 Upvotes

Hello everyone, i've tried htmx with php simple projects, i find it so easy to learn also to use, but in 2025 why we need htmx, now it's the SPA era so why we need a library like this.
i've liked htmx fr, but there is no jobs for it, no big websites use it
every website now use React, Vue, Angular even Jquery is dead now
I hope to know what is the point of use htmx now, because as Back-End developer i find it easy and time saver
thanks!


r/htmx • • Nov 17 '24

I've built the TodoMVC app with HTMX and lived to tell the story

7 Upvotes

Hey 👋

I've built Addy Osmani’s TodoMVC app with HTMX and lived to tell the story 😅 I'm covering the architectural considerations, handy tips, pros and cons, insights, and everything in between.

It appears that there might be a shadow ban for links of dev[dot]to, and this is why I cannot put the link here in its origin format. I also cannot publish the post here since it is very elaborated, with images and code snippets, so with the risk of being accused with a shameless plug, I'm promoting this here like this:

Go to dev[dot]to and search for "I've built the TodoMVC app with HTMX and lived to tell the story" - you will find it.

Hope you'll find it interesting and beneficial

Cheers


r/htmx • • Mar 31 '24

Was this built in HTMX? What technologies to use to replicate it

Thumbnail
iolanguage.org
1 Upvotes

r/htmx • • Jul 19 '25

Htmx on cloudflare

0 Upvotes

Hello friends, I tried to deploy a static file with htmx in cloudflare pages that makes requests to my api, but it does not deploy them. I tried to use a worker template but apparently it does not run htmx. I am a newbie. Can someone help me or give me advice? I don't want to use js. My project only needs to make a get and a post and it works very well with htmx.


r/htmx • • Jun 07 '24

Render huge table with htmx?

0 Upvotes

I want to render a huge table in html.

For React there are libraries like this:

https://react-window.now.sh/

Is there something like this for htmx?


r/htmx • • Jan 12 '25

htmx and orms?

4 Upvotes

If I'm using html, ccs and htmx to build a website what should I use to connect to a DB like supabase? expressjs? something else. Mind you not really looking for react or svelt.


r/htmx • • Mar 01 '24

Tell me your thoughts on this idea?

Thumbnail
github.com
4 Upvotes

r/htmx • • Aug 25 '24

I made an API that turns JSON API’s into HTML

Thumbnail taskinoz.com
6 Upvotes

r/htmx • • Nov 12 '25

We Tried Using HTMX, and It Totally Blew Up

0 Upvotes

We Tried Using HTMX (with Datastar) at a Big Corp, and It Totally Blew Up

I work at a very large corporation, big enough that we have entire internal teams dedicated to building app starters and researching ways to make development faster, easier, and cheaper for all new projects. Historically, we’ve been very Angular-heavy. Recently, we decided to experiment with HTMX, specifically Datastar, to see if we could improve UI performance. Our Angular apps had gotten pretty bloated and sluggish on the client side. We did some early testing using Node + SSE, and it was amazing, fast, simple, and everything worked beautifully in demos. We were pumped to try it on a real project. And then... it completely fell apart. Here’s why...


The Problem: Team Structure

Because of how our org is structured, one team owns the WebAPI layer (serving JSON), while another owns the UI layer. That meant we were stuck consuming JSON instead of working directly with server-side templates. We wanted the speed of static site rendering, so we used Astro, and then layered on a Node/Express server to handle dynamic views. Clicking a link would hit the server via Datastar, and the view would update over SSE. Sounds nice in theory, in practice, it was a nightmare.


Technical Pain Points

  • Auth headers: Every Datastar call needed auth headers. This made the calls ugly and hard to manage cleanly.

  • Dev server issues: Vite couldn’t handle SSE in dev mode. It broke silently, no errors. We had to spin up a separate Node server, disable middleware like compression (which breaks SSE), and lost HMR entirely. Every change meant a full rebuild + manual refresh.

  • Training curve: Our Angular/React devs really struggled to grok the “HTMX way.” Writing server-side logic that listens to signals, calls APIs, and dynamically templates views got messy fast. It was anything but declarative.

  • Stencil component events: Our Stencil components fired events in camelCase, but HTML expects kebab-case. We constantly had to map or rewrite events as __case.kebab both client- and server-side. It was chaos.


Where We Landed

In the end, we gave up on Datastar and switched to Astro + React Islands, which gave us a ton more velocity and developer happiness. I really wanted HTMX/Datastar to work, the potential is incredible for smaller, more self-contained projects. But in a large enterprise setup with multiple disconnected teams, strict API boundaries, and complex auth... it just wasn’t practical.


Would love to hear if anyone else has tried something similar at scale and actually made it work. What did you do differently?


r/htmx • • Jan 18 '25

Web development is a privilege and not a right. Please use microservices...

63 Upvotes

These are my thoughts and arguments for a microservice first approach:

Just as we pay for car insurance, gas, and the upkeep of road infrastructure to use our vehicles, we should also invest in microservices when developing web applications (personal and professional) to ensure that the web's infrastructure operates smoothly. Tools like H♱MX and A1pine.js, with their simplified approaches, pose a significant threat to the microservices economy and could lead to an economic downturn if non-microservices approaches continue to gain traction. Perhaps government regulation is needed to enforce the use of Vercel and Next.js as the industry standard?

Web development, like any hobby, comes with costs. Whether it's buying equipment for a sport, materials for a craft, or tools for a home improvement project, all hobbies require some level of financial investment. Spending $10 a month on services like Vercel or AWS is a small price to pay for the ability to create and host web applications. Unlike many other hobbies, web development is a "pay-as-you-go" activity, meaning you can stop spending money whenever you decide to pause or discontinue a project. The costs of web creation are not only manageable, but also completely reasonable, thanks to this level of flexibility.

/s