Documentation
CSV Export (beta)
SimpleTable makes it easy to export your table data to CSV format with just one method call. Using the tableRef
and the exportToCSV()
method, users can download their data for analysis, reporting, or sharing.
Basic Usage
To enable CSV export in your table, follow these steps:
- Create a table reference - Create a ref using
useRef
and pass it to thetableRef
prop - Add an export button - Create a button or trigger that calls the export method
- Call exportToCSV() - Invoke
tableRef.current?.exportToCSV()
to download the CSV file
CSV Export Configuration
The exported CSV includes all visible columns and respects active filters/sorting. Default filename is table-export.csv
. Customize with exportToCSV({ filename: "my-file.csv" })
.