AdaptTable for Reka UI

CSV export in Reka UI

Compose exportCsv() and an export button joins the toolbar. It writes the page on screen as it stands — sorted, filtered and searched — to a CSV file the browser downloads.

A column's exportValue decides what the file gets, so a cell that shows a formatted date range exports the plain start date a spreadsheet sorts.

The code

<script setup lang="ts">
import type { ColumnDef } from "@adapttable/vue";
import { DataTable } from "@adapttable/reka-ui";
import { exportCsv } from "@adapttable/reka-ui/export";

defineProps<{ rows: readonly Person[] }>();

const columns: ColumnDef<Person>[] = [
  { key: "name", sortable: true },
  { key: "team" },
  { key: "budget", sortable: true },
];
const rowKey = (row: Person) => row.id;
const features = [exportCsv()];
</script>

<template>
  <DataTable
    :data="rows"
    :columns="columns"
    :row-key="rowKey"
    :features="features"
  />
</template>

Install

pnpm add @adapttable/reka-ui @adapttable/vue @adapttable/core reka-ui

The same feature in the other kits

More Reka UI features

Reference: exporting, export-pdf. More of this kit: AdaptTable for Reka UI, or the live demo.