Components / Tables
Tables & selection
A reusable controller for authored HTML tables. Search, sort and select without changing the underlying demo data.
Run table
Selection applies to the current page and clears when the result set changes. Export includes all filtered rows, not only the visible page.
Scroll horizontally for status and duration →
| Status | |||
|---|---|---|---|
| Authentication guardrun-142 | Needs review | 8 min | |
| Billing exportrun-143 | Ready | 12 min | |
| Cache cleanuprun-144 | Ready | 4 min | |
| Dependency auditrun-145 | Needs review | 16 min | |
| Error boundaryrun-146 | Ready | 6 min | |
| Filter persistencerun-147 | Needs review | 10 min |
No matching runs
Try a different name or reset the table.
Bulk review is a local confirmation example; no run or integration is updated.
Independent instance
This table has its own search, sorting and selection. Changes here do not affect the runs above.
Scroll horizontally for status and owner →
| Status | |||
|---|---|---|---|
| Atlas APIproject-atlas | Ready | 21 min | |
| Beacon dashboardproject-beacon | Needs review | 9 min | |
| Copper docsproject-copper | Ready | 14 min |
No matching projects
Try a different name or reset the table.
Markup & reuse
Import createDataTable from
src/theme/ts/data-table.ts and initialize each root
once. Rows stay in semantic HTML; the controller manages local
filtering, stable sorting, page-scoped selection, pagination, column
visibility and CSV export. This is not a virtualized or server-side
data grid.
Initialization and local actions
import { createDataTable } from "./src/theme/ts/data-table";
const root = document.querySelector("[data-table]");
const table = createDataTable(root);
// Handle domain-specific actions in your project code.
const selectedIds = table.getSelectedIds();
table.clearSelection();
table.setState("loading"); // ready | loading | error | denied
table.reset();
table.destroy(); // remove listeners when the view is discarded
Validate and authorize any real bulk action on your server. The supplied review action only confirms the selected fixture IDs in memory. The controller does not fetch data or write to storage.
Authored row contract
<div data-table>
<div data-table-content>
<!-- Label search, filter, page size and selection controls. -->
<table>
<caption>Run history</caption>
<thead><!-- Named sortable column headings --></thead>
<tbody data-table-body>
<tr data-row-id="run-142"
data-search="Authentication guard run-142"
data-filter="review"
data-sort-name="Authentication guard"
data-sort-duration="8">
<th scope="row" data-column="name">Authentication guard</th>
<td data-column="duration">8 min</td>
</tr>
</tbody>
</table>
</div>
<p data-table-status role="status"></p>
</div>
Use a unique data-row-id for each row. Sort buttons
declare data-table-sort and
data-sort-type; column headers and cells share
data-column. Keep a caption, scoped headers and an
accessible name on every checkbox. Copy the complete working
specimen when adding the optional controls.
Keyboard: Tab reaches search, native selects, checkboxes and sort buttons. Space toggles selection; Enter activates a sort or action. The table scroll region can be focused at narrow widths. Loading and permission states are simulations, not real access control.