Playground
| Updated | |||
|---|---|---|---|
| billing-api | Deployed | A. Reyes | 2 min ago |
| auth-service | Degraded | J. Kim | 18 min ago |
| reporting-worker | Failed | S. Patel | 1 hr ago |
| notifications | Queued | A. Reyes | 3 hr ago |
Selectable
Sorting
| Updated | |||
|---|---|---|---|
| billing-api | Deployed | A. Reyes | 2 min ago |
| auth-service | Degraded | J. Kim | 18 min ago |
| reporting-worker | Failed | S. Patel | 1 hr ago |
| notifications | Queued | A. Reyes | 3 hr ago |
Service, Status, and Owner are sortable — click a header to sort ascending, click again for descending, a third click clears it. The Status column sorts by its label text via sortValue, since its cell renders a Badge, not plain text.
Selection
| Updated | ||||
|---|---|---|---|---|
| billing-api | Deployed | A. Reyes | 2 min ago | |
| auth-service | Degraded | J. Kim | 18 min ago | |
| reporting-worker | Failed | S. Patel | 1 hr ago | |
| notifications | Queued | A. Reyes | 3 hr ago |
1 of 4 selected. The header checkbox shows indeterminate when only some rows are checked.
Pagination
| Updated | |||
|---|---|---|---|
| billing-api | Deployed | A. Reyes | 2 min ago |
| auth-service | Degraded | J. Kim | 18 min ago |
| reporting-worker | Failed | S. Patel | 1 hr ago |
| notifications | Queued | A. Reyes | 3 hr ago |
1–4 of 9
pageSize=4 against 9 rows — self-contained internal page state, same pattern as sorting. Combine with sortable columns freely; changing sort resets back to page 1.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| columns | TableColumn<Row>[] | — | { key, label, render?(row), sortable?, sortValue?(row) } — render is optional; omit to print row[key] directly. |
| rows | Row[] | — | Array of plain data objects. |
| getRowKey | (row: Row) => string | — | Stable unique key per row, same as a React list key. |
| selectable | boolean | false | Adds a checkbox column. Requires selectedKeys/onSelectionChange to actually do anything (controlled, same pattern as Switch). |
| selectedKeys | string[] | — | Currently-selected row keys. |
| onSelectionChange | (keys: string[]) => void | — | Called with the full next selection whenever a row or the header checkbox is toggled. |
| onRowClick | (row: Row) => void | — | Makes rows clickable (e.g. navigate to a detail view). Doesn't fire when clicking the selection checkbox. |
| pageSize | number | — | Opt-in pagination — self-contained internal page state, same pattern as sorting. Omit to render every row. |
Usage Guidelines
When to use
- Use for structured, multi-column, row-based data where users compare values across a column.
- Use sortable + sortValue when a column's cell renders something other than plain text (a Badge, a formatted date) so sorting still works on the underlying value.
- Use pageSize once a dataset regularly exceeds a screenful of rows — it's self-contained, no extra state to wire up.
When not to use
- Don't use Table for a simple list of one attribute per item — a plain list is lighter.
- Don't combine pageSize with a dataset the user needs to scan/compare in full — pagination hides rows, which works against that.