I'm not sure about HTMX, but this kind of behaviour is what Unpoly https://unpoly.com/ excels at
I played with it recently and it was pretty easy to enhance a completely non-js CRUD type app and have it fall-back gracefully. Seems a similar concept to HTMX but has a more batteries included / high-level approach.