Data Export
SeizenTable supports data export through the FileExportPlugin from @izumisy/seizen-table-plugins.
Try It
Section titled “Try It”Click the export icon in the side panel to download the table data in CSV, TSV, or JSONL format.
Installation
Section titled “Installation”npm install @izumisy/seizen-table-pluginspnpm add @izumisy/seizen-table-pluginsBasic Usage
Section titled “Basic Usage”import { useSeizenTable, SeizenTable } from "@izumisy/seizen-table";import { FileExportPlugin, CsvExporter, JsonlExporter, TsvExporter,} from "@izumisy/seizen-table-plugins/file-export";
function MyTable() { const table = useSeizenTable({ data, columns, plugins: [ FileExportPlugin.configure({ filename: "my-data", exporters: [CsvExporter, JsonlExporter, TsvExporter], }), ], });
return <SeizenTable table={table} />;}Built-in Exporters
Section titled “Built-in Exporters”| Exporter | Format | Extension | Description |
|---|---|---|---|
CsvExporter | CSV | .csv | Comma-separated values |
JsonlExporter | JSONL | .jsonl | JSON Lines (one JSON object per line) |
TsvExporter | TSV | .tsv | Tab-separated values |
Configuration Options
Section titled “Configuration Options”| Option | Type | Default | Description |
|---|---|---|---|
width | number | 300 | Width of the side panel |
filename | string | "export" | Default filename (without extension) |
includeHeaders | boolean | true | Include column headers in export |
exporters | Exporter[] | [CsvExporter] | Available export formats |
Export Behavior
Section titled “Export Behavior”- Exports visible columns only (respects column visibility settings)
- Exports all rows matching current filters
- Users can customize the filename before downloading
Custom Exporter
Section titled “Custom Exporter”Create your own exporter by implementing the Exporter interface:
import type { Exporter } from "@izumisy/seizen-table-plugins/file-export";
const MarkdownExporter: Exporter = { id: "markdown", name: "Markdown Table", extension: "md", mimeType: "text/markdown", convert: (data, columns, options) => { const headers = columns.map((c) => c.header); const separator = columns.map(() => "---"); const rows = data.map((row) => columns.map((col) => String(row[col.key] ?? "")) );
return [ `| ${headers.join(" | ")} |`, `| ${separator.join(" | ")} |`, ...rows.map((r) => `| ${r.join(" | ")} |`), ].join("\n"); },};