Click to Load
This example shows how to implement click-to-load the next page in a table of data. The crux of the demo is the final row:
<tr id="replaceMe">
<td colspan="3">
<button class='btn primary' hx-get="/contacts/?page=2"
hx-target="#replaceMe"
hx-swap="outerHTML">
Load More Agents... <img class="htmx-indicator" src="/img/bars.svg" alt="">
</button>
</td>
</tr>
This row contains a button that will replace the entire row with the next page of results (which will contain a button to load the next page of results). And so on.
Server Requests ↑ Show
HTML
🔗Demo
| Name | ID | |
|---|---|---|
| Agent Smith | void10@null.org | |
| Agent Smith | void11@null.org | |
| Agent Smith | void12@null.org | |
| Agent Smith | void13@null.org | |
| Agent Smith | void14@null.org | |
| Agent Smith | void15@null.org | |
| Agent Smith | void16@null.org | |
| Agent Smith | void17@null.org | |
| Agent Smith | void18@null.org | |
| Agent Smith | void19@null.org | |