Building Progressively Enhanced Forms with htmx
Building progressively enhanced forms using Htmx
Rafa shares his approach to building a bookmark editing form for ties.pub using progressive enhancement. He starts with a no-JS version, then layers htmx for interactivity like live search. The post covers managing transient state with form values and query parameters, detecting which button was pressed, and the importance of scoping htmx swaps. He also recommends resources for learning more about server-rendered HTML and htmx.
It usually surprises me how little htmx is really needed when I follow this approach.
- yawaramin
> Fiddling with out-of-band swaps to solve this feels error prone and overly hard to maintain.
This is almost always because of using a string-based templating system. If you use a language-embedded HTML generation library, it represents HTML fragments as first-class values in your language, and you can compose them together in flexible ways. This makes out-of-band swaps very simple.
- arthurcolle
Video doesn't seem to be rendering, has 0:00 and 0:00 as start and end times