A Bootstrap 6 orders table with a checkbox on every row, a select-all box in the header and a bulk actions bar that turns dark as soon as something is selected. It fits admin panels, order back offices, file managers and any list where users need to act on many records at once.
How it works
The root .tcs-root holds a header, the .tcs-bulk toolbar and a .table-responsive wrapper with a .table.table-hover table. Each body row carries its amount in data-tcs-total and a <input type="checkbox" class="check tcs-row-check">. The header box .tcs-all selects or clears all rows.
script.js runs one sync() function after every change. It adds .tcs-selected to checked rows, sets the header box to checked or indeterminate, writes the count into .tcs-count and the formatted sum of the selected data-tcs-total values into .tcs-sum. It also toggles .tcs-has-selection on the root, which switches the toolbar from the hint text to the action buttons.
A click anywhere on a row toggles its checkbox, and Shift + click selects or clears the whole range since the last clicked row. The actions use data-tcs-action:
shipsets the status badge of the selected rows to Shipped.deletefades rows out with.tcs-leaving, removes them, and shows a Toast with Undo that puts them back in their original order.clearunchecks everything.
The Export button opens a Bootstrap 6 Menu with data-tcs-export items (CSV, JSON, PDF). They are simulated and report back through Toast.getOrCreateInstance(...).show().
Customization
--tcs-accentand--tcs-accent-softon.tcs-root: change the checkbox fill, the selected row tint, the count bubble and the primary buttons.--tcs-inkon.tcs-root: sets the dark color of the active bulk bar and the toast.data-tcs-totalon each<tr>: the amount added to the selected sum. Change themoneyformatter inscript.jsfor another currency.- Add a button with a new
data-tcs-actionvalue in.tcs-bulk-actionsand handle it in the action listener (archive, assign, tag…). - Remove
checkedfrom the first two.tcs-row-checkinputs to start with nothing selected. - Replace the
setTimeoutin thedeletebranch and the export handler withfetch()calls to your API.
Use cases
- Order management: select orders with row checkboxes and act on them together
- Admin tables: a select-all box turns indeterminate when only some rows are selected
- Back-office tools: Shift-click selects a range of rows in one move
- Exports and cleanup: a bulk actions bar offers an export menu, delete and undo
Accessibility
The bulk bar is a role="toolbar" with a label, and its count sits in an aria-live="polite" paragraph, so screen readers hear "3 selected" as it changes. Every checkbox has an aria-label naming its order, the header checkbox exposes the mixed state through indeterminate, and the order number is a row header (th scope="row"). After a delete or Clear, focus returns to the select-all box. The toast is a polite status. Fades are turned off under prefers-reduced-motion.
Bootstrap 6 notes
Bootstrap 5's form-check-input becomes a bare .check, btn-primary becomes btn-solid theme-primary, and the dropdown is now a flat .menu triggered by data-bs-toggle="menu" with data-bs-placement="bottom-end" instead of dropdown-menu-end. Status labels use badge badge-subtle theme-*. The brand color reaches the checkboxes through --bs-control-checked-bg on the root. Built on Bootstrap 6.0.0-alpha.1, so APIs may still change. Icons come from Bootstrap Icons.