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"></parqui>
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. Use an arrow-function property so the handler keeps its component context. It runs inside the Angular zone, so change detection picks up any state it updates.
Loading...
To keep the browser download but choose the file name at export time, call downloadAsFile from the handler:
import { Component } from "@angular/core";
import { ParquiComponent, downloadAsFile, type ExportingFile } from "@parqui/angular";
@Component({
selector: "app-root",
standalone: true,
imports: [ParquiComponent],
template: `<parqui source="/data.parquet" [onExporting]="onExporting"></parqui>`,
})
export class AppComponent {
// Arrow function keeps `this` bound to the component
onExporting = ({ blob, format }: ExportingFile) => {
const date = new Date().toISOString().slice(0, 10);
downloadAsFile(blob, `report-${date}.${format}`, blob.type);
};
}API
| Prop | Type | Default | Description |
|---|---|---|---|
exporting | boolean | ParquiExportingOptions | true | true 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. |
ParquiExportingOptionsformats("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.ExportingFileblobBlobThe 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.