@objectifthunes/whiteboard
PAGE SHELLS

ListPage

The catalog page. Note, stats, view split, toolbar, rows, paging — the order and rhythm decided once, every slot optional.


PREVIEW

Invoices

Every slot below is optional and renders nothing when omitted.

2 invoices are overdue.

Dismiss
Outstanding
€10,679

2 open invoices

Paid
this quarter
€1,703
InvoiceClientStatus
INV-2089Northwind Tradingdue
INV-2077Initechpaid
INV-2065Umbrella Healthdue
INV-2041Globexpaid

1–4 of 4

SOURCE
import { ListPage, TableToolbar, DataTable, Pagination, StatRow } from '@objectifthunes/whiteboard'

<ListPage
  breadcrumbs={<Breadcrumbs items={crumbs} />}
  note={<NoteBar tone="error" onDismiss={dismiss}>{overdueMessage}</NoteBar>}
  stats={<StatRow items={recap} />}
  views={<Tabs value={tab} onChange={setTab} items={savedViews} />}
  toolbar={<TableToolbar search={…} filters={…} columns={columns} onColumnsChange={setColumns} />}
  pagination={<Pagination page={page} pageCount={pageCount} onPageChange={setPage} total={total} />}
>
  <DataTable columns={columns} rows={rows} rowKey={r => r.id} />
</ListPage>
NOTES

The shape almost every list-of-records screen shares. Its value is that the order and the rhythm are decided once: note above stats, stats above the view split, the split above the toolbar, search on its own line, rows, then paging.

Every slot is optional and renders nothing when omitted, so the same shell serves a bare table and a fully loaded operations screen.

It holds no state. Filtering, sorting and paging belong to the caller, which is the only thing that knows whether the data is a local array or a server page.