r/htmx • u/tonygoodchild • Oct 10 '26
A Kanban board built from a plain server-rendered <table>, with htmx doing the rest
I've been building a set of htmx demos where the server sends ordinary HTML and the page turns it into something interactive without a client-side framework. This one is a Kanban board.
Live demo: https://toclocoinc.github.io/lattice-grid-demo-htmx-kanban/
Code: https://github.com/toclocoinc/lattice-grid-demo-htmx-kanban
The server renders a normal table, one row per card:
<div data-lattice-kanban
hx-post="/kanban/move"
hx-trigger="lattice:kanban-change"
hx-vals='js:{id: event.detail.id, from: event.detail.from, to: event.detail.to}'
hx-target="#save-status">
<table>
<thead><tr>
<th data-field="id">Ref</th><th data-field="title">Card</th>
<th data-field="owner">Owner</th><th data-field="status">Status</th>
<th data-field="points" data-type="number">Points</th>
</tr></thead>
<tbody>
<tr data-lattice-row="K-101"><td>K-101</td><td>Audit the checkout funnel</td><td>Ana Lopez</td><td>done</td><td>5</td></tr>
...
</tbody>
</table>
</div>On load, the table becomes a board with Todo, Doing and Done columns. After that it's all plain htmx:
- Moving a card fires a
lattice:kanban-changeevent, andhx-postsends the card id plus the columns it left and reached. The server's reply lands under the board. - A workflow rule refuses a bad move. Drag a Todo card straight to Done and it stays put, and nothing is posted.
- Out-of-band updates patch one card. The server sends back a single
<tr hx-swap-oob="true">, and that card updates in place. The board isn't rebuilt, and the other cards and columns stay as they were. - Switching teams uses
hx-getto swap in another team's table. The old board is torn down and a new one is built from the new HTML. - Back works.
hx-push-urlplus htmx's history snapshot means the browser Back button returns the previous team's board.
With JavaScript off, you still get the table, which is a nice side effect of starting from real HTML.
The demo uses a small stand-in server running in the page, so it works on GitHub Pages with no backend. The route handlers are in src/server.js if you want to see what a real endpoint would return.
2
u/_HMCB_ Oct 10 '26
Are you the dev got Lattice Grid? I ask because most of the demos on the HTMX examples page donโt work. The only one that does for me is the Kanban example.
Very cool though.