EXAMPLE SCREENS
Invoices
The catalog screen end to end: search and filters, a sortable selectable table, a detail drawer, bulk actions and ⌘K.
PREVIEW
SOURCE
import {
Tabs, TableToolbar, SearchBar, FilterTabs, DateRangePicker, ToggleChip,
DataTable, Pagination, Drawer, Modal, StickyBar, applyTableSort,
} from '@objectifthunes/whiteboard'
// Filter → sort → page, all in the page. The table only reports.
const filtered = INVOICES.filter(matchesFilters)
const sorted = applyTableSort(filtered, columns, sort)
const rows = sorted.slice((page - 1) * perPage, page * perPage)
<Tabs value={tab} onChange={setTab} items={[
{ id: 'all', label: 'All', badge: INVOICES.length, content: table },
{ id: 'unpaid', label: 'Unpaid', badge: unpaidCount, content: table },
]} />
// The table block is one node, reused by every tab:
<TableToolbar
search={<SearchBar value={query} onChange={setQuery} label="" />}
filters={<><FilterTabs … /><DateRangePicker … /><ToggleChip … /></>}
columns={columns}
onColumnsChange={setColumns}
actions={<Button>New invoice</Button>}
/>
<DataTable
columns={columns} rows={rows} rowKey={r => r.id}
sort={sort} onSortChange={setSort}
selectedKeys={selected} onSelectionChange={setSelected}
onRowClick={setOpen} activeKey={open?.id}
stickyHeader
/>
<Pagination page={page} pageCount={pageCount} onPageChange={setPage} total={sorted.length} />
{selected.length > 0 && <StickyBar contained>…</StickyBar>}
<Drawer open={open !== null} onClose={() => setOpen(null)} title={open?.id}>…</Drawer>NOTES
Everything here is a kit export. Tabs switches the view, TableToolbar holds the search and filters, DataTable sorts and selects, Pagination pages, Drawer opens the row, and StickyBar appears once something is selected.
Tick two rows to raise the bulk bar, click a row to open the drawer, and open the Columns menu to hide a column without it closing between ticks. The date range filter is a real two-click DateRangePicker.
The 47 rows are generated arithmetically rather than randomly, so the screen looks the same on every reload. Filtering, sorting and paging all happen in the page — the table itself reports and never decides.