htmx's Out of Band Swaps feature allows updating multiple parts of a page with a single server response. When combined with Thymeleaf, this requires the htmx-spring-boot-thymeleaf library. A practical todo app example demonstrates how adding a new item can simultaneously update the todo list and the active items count in one HTTP call, instead of two separate requests. The library enables returning multiple Thymeleaf fragments in a single response, with secondary fragments marked using hx-swap-oob="true" so htmx knows to swap them by matching element IDs.
Sort: