Add-row button
Prop showAddRow — adapter chrome, default follows enableRowActions.
Guide
When to use it
Surface an Add row button in the toolbar so users can append rows without a keyboard shortcut or a custom control.
How it works
showAddRow is pure chrome — it renders the toolbar button and calls the row-add action. It
follows enableRowActions: if that behaviour is off, the button doesn't appear.
Gotchas
- It's a no-op without
enableRowActions— chrome never turns on behaviour, it only exposes it. - Same button in both skins; swap
BstTableMuiforBstTableShadcnand it renders in that style.
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' },
]
const withAction: BstTableColumn<Row>[] = [...columns, { id: 'actions', accessorKey: 'id', header: 'Actions', meta: { type: 'action' } }]
export default function App() {
const [rows, setRows] = React.useState(seed)
return (
<BstTableMui data={rows} columns={withAction} getRowId={(r) => r.id}
enableEditing enableRowActions showAddRow onDataChange={setRows} />
)
}
Loading live example…
Overview
| Layer | show* (chrome, resolved in the adapter) |
| Type | boolean |
| Default | follows enableRowActions |
| Maps to | adapter toolbar |
| Status | ✅ done (Phase 2) |
| Since | v0.2.0 |
Enable it
<BstTableMui
data={rows}
columns={columns}
enableRowActions // chrome is a no-op without its behaviour flag
showAddRow
/>
Swap
BstTableMuiforBstTableShadcn(and the CSS import) for the shadcn skin — same props.
Behavior & interactions
- Requires
enableRowActionsto be on — this flag is a no-op otherwise.