Skip to main content

Save/Discard bar

Prop showSaveBar — adapter chrome, default follows enableEditing.

Guide

When to use it

Show an explicit Save / Discard bar for row and deferred editing, so users commit a set of edits on purpose rather than on blur.

How it works

showSaveBar renders the bar whenever there are pending edits and follows enableEditing. In batch mode, prefer showChangesSheet — a richer review panel that replaces the plain bar.

Gotchas

  • No-op without enableEditing.
  • Redundant with showChangesSheet: use the save bar for row mode, the changes sheet for batch.

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 editable: BstTableColumn<Row>[] = columns.map((c) =>
c.id === 'name' || c.id === 'score'
? { ...c, meta: { type: c.id === 'score' ? 'number' : 'text', editable: true } }
: c)
export default function App() {
const [rows, setRows] = React.useState(seed)
return (
<BstTableMui data={rows} columns={editable} getRowId={(r) => r.id}
enableEditing={{ mode: 'batch' }} showChangesSheet onDataChange={setRows}
onSave={({ rows }) => alert(rows.length + ' row(s) saved')} />
)
}
Loading live example…

Overview

Layershow* (chrome, resolved in the adapter)
Typeboolean
Defaultfollows enableEditing
Maps toadapter toolbar
Status✅ done (Phase 2)
Sincev0.2.0

Enable it

<BstTableMui
data={rows}
columns={columns}
enableEditing // chrome is a no-op without its behaviour flag
showSaveBar
/>

Swap BstTableMui for BstTableShadcn (and the CSS import) for the shadcn skin — same props.

Behavior & interactions

  • Requires enableEditing to be on — this flag is a no-op otherwise.