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.
Outstanding
2 open invoices
Paid
this quarter| Invoice | Client | Status |
|---|---|---|
| INV-2089 | Northwind Trading | due |
| INV-2077 | Initech | paid |
| INV-2065 | Umbrella Health | due |
| INV-2041 | Globex | paid |
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.