Skip to content

Export

Strata ships CSV and XLSX writers plus a useExport hook and an ExportMenu component for wiring them into an interface.

const exportApi = useExport({
getVisibleRows: () => rows,
getAllRows: () => rows,
getSelectedRows: () => selectedRows,
columns: exportColumns,
getRowValue: (row, columnId) => String(row[columnId] ?? ''),
});
<ExportMenu
formats={['csv', 'xlsx']}
onExport={(format) =>
exportApi.exportData({ format, scope: 'visible', filename: 'orders' })
}
/>;

Direct use of the writers is also supported through CsvWriter and XlsxWriter.

Name
Qty