Conceptual
Login

Splitting Server State in HTMX from Client State in Alpine.js

HTMX owns anything the server must know, and Alpine owns only state that lives in the browser, like an open menu. Alpine passes changes to HTMX with $dispatch and hx-trigger from:body, and Alpine state inside a swapped area is lost on each swap.