Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

IIUC I think it's possible, but maybe a bit clunky. Htmx let's you choose the swap target, and you can replace any part the page, not just the section that triggered the swap. You can also replace multiple targets.

https://htmx.org/attributes/hx-swap-oob/

Also, there's nothing stopping you from writing a bit of JS to handle something htmx can't do.

For example, the initial GET could return two partials, one hidden by default until a user action triggers a JS swap while htmx performs the request and eventually replaces the div again along with any other out of band div(s).



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: