Bulk actions
Select some rows, then act on all of them at once. Same todos as the todos demo, different view.
No todos yet.or make your own on the todos demo.
What to look at
The checkboxes sit in a form with no submit button. The action buttons live outside it, in the toolbar, and pull the checked values in with hx-include="#bulk-form". The server gets id=3&id=7 like any form post.
Alpine keeps the "3 selected" label and the disabled state in sync with x-model="selected" on each checkbox. Checkboxes bound to an array give you a list of checked values for free. The header checkbox sets that list to everything or nothing.
hx-confirm is the built-in confirmation. One attribute, a native dialog, no Alpine needed for that one.
Every action returns the whole table again, so the selection resets and the counts are right. One component, BulkTable.astro, for the page and every response.