Master-detail
Prop enableExpanding — engine behaviour, default false.
Guide
When to use it
Master-detail — click a row to reveal a full-width panel with more detail, sub-records, or a nested table.
How it works
Adds a leading expander column and renders your renderDetail(row) as a full-width row beneath the
expanded one. Control which rows can open with getRowCanExpand.
Gotchas
- Row virtualization yields to expanding (detail rows need real DOM), so long lists with many open panels are heavier.
- The detail panel is your React — a nested
<BstTable>is fine for a different column set.
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}
enableExpanding getRowCanExpand={() => true}
renderDetail={(row) => (
<div style={{ padding: 14, background: '#f8fafc' }}>
Detail for <b>{row.name}</b> — {row.role} on the {row.team} team, score {row.score}.
</div>
)} />
)
}
Overview
| Layer | enable* (engine, resolved in useBstTable) |
| Type | boolean |
| Default | false |
| Maps to | v9 rowExpandingFeature — leading expander column + full-width detail panel row |
| Status | ✅ done |
| Since | v0.13.0 |
| Settings sheet | Rows |
Master-detail — a leading expander column; clicking it reveals a detail panel row rendered by renderDetail. Opt-in. Default false. Built on v9's rowExpandingFeature.
Enable it
<BstTableMui
data={rows}
columns={columns}
enableExpanding
/>
Swap
BstTableMuiforBstTableShadcn(and the CSS import) for the shadcn skin — same props.
Options
| Option | Notes |
|---|---|
renderDetail | Related prop for this feature. |
getRowCanExpand | Related prop for this feature. |
renderDetail | without it an expanded row shows an empty detail panel |
Behavior & interactions
- Optionally narrow which rows expand with
getRowCanExpand.
Spec coverage
Spec codes (
A1,C2,X8, …) are Bst-Table's internal requirement IDs from the capability matrix;P0–P2mark the delivery phase. They are traceability tags, not part of the public API.
- A4 · Nested / master-detail — ✅ built. v0.13.0 — enableExpanding + renderDetail