Export

Let users download the data they see as CSV, JSON or NDJSON, or handle the exported file in your own code.

How it works

Export is on by default. Once a file is loaded, the toolbar shows an Export menu. It exports exactly what the user sees: the visible columns in their current order, with filters, sorting and search applied. The menu is part of the toolbar, so it is not shown when showToolbar is false.

Loading...

Formats and file name

Pass an options object to exporting to pick the formats, set the file name and tune CSV or JSON output. With a single format the menu becomes a direct download button.

Loading...

Disable export

<Parqui source="/data.parquet" exporting={false} />

exporting={false} only hides the built-in menu. exportData from the toolbarActions API keeps working, so you can build your own export UI.

Custom saving

Pass onExporting to handle the exported file yourself: upload it, save it through a native dialog, or log it. It receives { blob, filename, format } and replaces the browser download.

Loading...

To keep the browser download but choose the file name at export time, call downloadAsFile from the handler:

import { Parqui, downloadAsFile } from "@parqui/react";

<Parqui
  source="/data.parquet"
  onExporting={({ blob, format }) => {
    const date = new Date().toISOString().slice(0, 10);
    downloadAsFile(blob, `report-${date}.${format}`, blob.type);
  }}
/>

API

PropTypeDefaultDescription
exportingboolean | ParquiExportingOptionstruetrue or omitted shows the menu with all formats; false hides it; an object customizes it.
onExporting(file: ExportingFile) => void | Promise<void>—Receives each exported file instead of the browser download.
ParquiExportingOptions
formats("csv" | "json" | "ndjson")[]Formats offered in the menu, in display order. Default: all. A single format turns the menu into a direct download button; an empty array hides it.
filenamestringBase file name without extension. Default: derived from the Parquet file name.
csv{ delimiter?, bom?, newline? }CSV options. Defaults: ",", UTF-8 BOM on (so Excel detects the encoding), "\r\n".
json{ indent? }Indentation of the JSON array. Default: 2. NDJSON is always one object per line.
ExportingFile
blobBlobThe serialized file contents, with a matching MIME type.
filenamestringFile name including the extension, e.g. mtcars.csv.
format"csv" | "json" | "ndjson"The format the user picked.

Need a one-off conversion? Try the online Parquet to CSV and Parquet to JSON converters, built on the same export.