Pagination (logic)
Prop pagination — engine behaviour, default true.
Guide
When to use it
On by default — page through rows instead of one long scroll. Pass an object to size the pages.
How it works
boolean | { pageSize }. Client-side by default; switch to server paging with manual mode +
pageCount. Page-size choices come from pageSizeOptions (numbers, or 'all').
<BstTableMui data={rows} columns={columns} getRowId={(r) => r.id}
pagination={{ pageSize: 25 }} pageSizeOptions={[10, 25, 50, 'all']} />
Gotchas
- The footer bar is
showPagination(on by default) — turn that off to keep paging logic but hide the bar. - For infinite scroll instead of pages, use
enableVirtualization+useBstInfiniteDataSourceand setpagination={false}.
Live example
Example source
import React from 'react'
import { BstTableMui } from '@bloomskill/table-mui'
import type { BstTableColumn } from '@bloomskill/table-engine'
import '@bloomskill/table-engine/styles.css'
type Row = { id: string; name: string; team: string; role: string; score: number }
const seed: Row[] = [
{ id: '1', name: 'Ada Lovelace', team: 'Platform', role: 'Engineer', score: 92 },
{ id: '2', name: 'Alan Turing', team: 'Research', role: 'Scientist', score: 88 },
{ id: '3', name: 'Grace Hopper', team: 'Platform', role: 'Engineer', score: 95 },
{ id: '4', name: 'Katherine J.', team: 'Research', role: 'Analyst', score: 90 },
{ id: '5', name: 'Edsger Dijkstra',team: 'Platform', role: 'Architect',score: 84 },
]
const columns: BstTableColumn<Row>[] = [
{ id: 'name', accessorKey: 'name', header: 'Name' },
{ id: 'team', accessorKey: 'team', header: 'Team' },
{ id: 'role', accessorKey: 'role', header: 'Role' },
{ id: 'score', accessorKey: 'score', header: 'Score', sortFn: 'basic' },
]
export default function App() {
return (
<BstTableMui data={seed} columns={columns} getRowId={(r) => r.id}
pagination={{ pageSize: 5 }} />
)
}
Loading live example…
Overview
| Layer | enable* (engine, resolved in useBstTable) |
| Type | boolean | {pageSize} |
| Default | true |
| Maps to | v9 pagination |
| Status | ✅ done |
| Since | v0.1.0 |
| Settings sheet | Data operations |
Pagination behaviour + initial page size. false shows all rows. Default: true.
Enable it
<BstTableMui
data={rows}
columns={columns}
pagination={/* boolean | {pageSize} */}
/>
Swap
BstTableMuiforBstTableShadcn(and the CSS import) for the shadcn skin — same props.