Hacker News new | ask | show | jobs
by llambda 1113 days ago
How does htmx compare with alpinejs (https://alpinejs.dev/)?
2 comments

HTMX and Alpine pair well together.

Generally, Alpine would handle pure client-side functionality, like toggling classes, expanding a drop-down multi-select, etc.

HTMX for server interactions, fetching, posting updates, etc.

One can accomplish a lot with little to no JS, with the app primarily driven by the backend. Which is quite a benefit if you know and like PHP/Python/Go/Elixir/C++ better than JS. Or just don’t like working in JS.

Alpine is more of a Vue replacement and HTMX is more of a fetch replacement. You can use both, although it’s a little redundant.