AdaptTable for Reka UI

Saved views in Reka UI

A view is the table's state — search, sort, filters and the column layout — saved under a name.

Save one from the views menu and pick it again later to put the table back the way it was. The list lives in this browser's storage, or in any store you hand savedViews.

The code

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

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 = [
  filters<Person>([]),
  savedViews({ storageKey: "people-views", urlKey: "people" }),
];
</script>

<template>
  <DataTable
    :data="rows"
    :columns="columns"
    :row-key="rowKey"
    url-key="people"
    :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: saved-views, url-state. More of this kit: AdaptTable for Reka UI, or the live demo.