I think what it takes to convince yourself that htmx is a worthy alternative to frameworks like React is to:
- Believe that the attributes htmx adds to HTML really should be part of HTML. Carson Gross would love for HTML to gain those features and then deprecate htmx.
- Implement the same web app in both htmx and any other framework and then compare the number of lines of code and the complexity of the code. I think htmx really shines here.
- Accept that htmx can’t do everything that other frameworks do and add the use of another client-side JavaScript library for extra dynamic behavior. Alpine.js works nicely with htmx because both just add attributes to HTML. My book shows many examples of using htmx and Alpine together.
For the most part I don’t think use of htmx needs to be limited to certain kinds of web applications. However, it’s not ideal for situations where a change in one part of the page requires updates to a large number of other parts (ex. spreadsheets with formulas). It’s also not ideal if operations like scrolling and scaling require getting new data from the server for every small change (ex. tiles in a Google Map).