AdaptTable for Reka UI

Row and column virtualization in Reka UI

Compose virtualize() and the table renders the rows in view plus a small overscan, whatever the dataset's size — forty thousand rows on this page, a few dozen of them in the page at once.

The scroll box scrolls rather than the page, and sorting and filtering keep working on the whole dataset rather than on what is drawn. virtualize({ virtualizeColumns: true }) does the same across, for column sets wider than the box.

The code

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

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 = [virtualize({ maxHeight: 480 })];
</script>

<template>
  <DataTable
    :data="rows"
    :columns="columns"
    :row-key="rowKey"
    pagination-mode="infinite"
    :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: virtualization. More of this kit: AdaptTable for Reka UI, or the live demo.