CSV export
Prop enableCsvExport — engine behaviour, default true.
Guide
When to use it
Keep (or drop) the CSV option in the export menu.
How it works
A sub-toggle of enableExport (on by default). Gates runtime.exportCsv and the CSV menu item;
output is RFC-4180 with a UTF-8 BOM (so Excel opens it cleanly).
Gotchas
- Only takes effect when
enableExportis on. - Set it
falseto offer Excel / Print but not raw CSV.
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}
enableExport showExport />
)
}
Loading live example…
Overview
| Layer | enable* (engine, resolved in useBstTable) |
| Type | boolean |
| Default | true |
| Maps to | custom — sub-toggle of enableExport; gates runtime.exportCsv + the CSV menu item (RFC-4180, UTF-8 BOM). In settings ("Export", always shown) |
| Status | ✅ done |
| Since | v0.34.0 |
| Settings sheet | Export |
CSV export sub-toggle. false hides the CSV menu item and makes runtime.exportCsv a no-op, while keeping Excel/Print. Needs enableExport. Default: true.
Enable it
<BstTableMui
data={rows}
columns={columns}
enableCsvExport
/>
Swap
BstTableMuiforBstTableShadcn(and the CSS import) for the shadcn skin — same props.
Behavior & interactions
- Requires
enableExportto be on — this flag is a no-op otherwise. - Defaults to ON — set false to hide the CSV item / no-op
runtime.exportCsvwhile keeping Excel + Print.