AdaptTable for Reka UI
AI table assistant in Reka UI Vue
This demo mounts a real Reka UI Vue table and its Reka UI assistant. Start with scripted sorting, questions and approved edits, or connect your HTTP backend for free-form AI requests. The scripted mode needs no model or API key.
A question filters the table only after you answer. A proposed edit waits for your approval in the assistant, the table or a dialog; an approved write updates the host's data and its status line. Rejecting leaves the data unchanged, and the conversation records the execution result.
tableAgent and useTableAssistant from @adapttable/ai-vue share the mounted table's session. The snippet below shows a minimal local sorting transport; the demo also includes questions and governed edits. JSON, OpenAI, HTTP, MCP, MCP Apps, WebMCP, AG-UI and AI SDK helpers can use the same session in your application.
The code
<script setup lang="ts">
import type { AgentSession, AssistantTransport } from "@adapttable/ai";
import { tableAgent, useTableAssistant } from "@adapttable/ai-vue";
import { shallowRef } from "vue";
import type { ColumnDef } from "@adapttable/vue";
import { DataTable } from "@adapttable/reka-ui";
import { TableAssistant } from "@adapttable/reka-ui/assistant";
interface AgentPerson { id: string; name: string; salary: number }
// A minimal local transport: no model, endpoint or API key.
const transport: AssistantTransport = {
send: async ({ session, text, signal }) => {
if (!text.toLowerCase().includes("sort")) {
return { text: "Try: sort salaries highest first." };
}
const key = "view.setSort";
const result = await session.execute(
key,
{ key: "salary", dir: "desc" },
session.manifest().viewRevision,
crypto.randomUUID(),
signal
);
return {
text: result.ok ? "Highest salary first." : "The sort was not applied.",
keys: [key],
results: [result],
};
},
};
const rows: readonly AgentPerson[] = [
{ id: "ada", name: "Ada Lovelace", salary: 120 },
{ id: "grace", name: "Grace Hopper", salary: 140 },
];
const columns: readonly ColumnDef<AgentPerson>[] = [
{ key: "name", header: "Person" },
{ key: "salary", header: "Salary", sortable: true },
];
const rowKey = (row: AgentPerson) => row.id;
const session = shallowRef<AgentSession>();
const open = shallowRef(false);
const assistant = useTableAssistant(() => ({
session: session.value,
transport,
open: open.value,
onOpenChange: (value) => {
open.value = value;
},
}));
const features = [tableAgent({
tableId: "people", approval: "never",
columns: { salary: { type: "number", sortable: true } },
bridge: { attach: (value) => { session.value = value; } },
})];
</script>
<template>
<DataTable
:data="rows" :columns="columns" :row-key="rowKey"
:features="features" :url-sync="false"
/>
<TableAssistant
:assistant="assistant.view.value"
:open="assistant.open.value"
:on-open-change="assistant.setOpen"
presentation="floating"
/>
</template>
Install
pnpm add @adapttable/reka-ui @adapttable/vue @adapttable/core reka-ui
The same feature in the other kits
- AI table assistant in Vue Unstyled — Native elements — your own CSS
- AI table assistant in Element Plus Vue — Element blue, crisp form controls
- AI table assistant in Vuetify Vue — Material Design, Vuetify blue
- AI table assistant in Naive UI Vue — Clean, compact, green accent
- AI table assistant in shadcn-vue — Monochrome, ring focus
- AI table assistant in Nuxt UI Vue — Tailwind-native, Nuxt green
- AI table assistant in Quasar Vue — Material-flavoured, Quasar blue
More Reka UI features
- Filtering in Reka UI — Ranges, selects, an AND/OR tree and chips — all in the URL.
- Column management in Reka UI — Show, hide, reorder, pin and resize — from a menu you did not write.
- Column groups in Reka UI — Spanning headers that collapse to a stub, a kept child, or a custom cell.
- Row selection in Reka UI — A set of ids that survives paging, with bulk actions over it.
- Rows in Reka UI — Pin rows from a 3-dot menu, and merge a team that runs down the page.
- Row reordering in Reka UI — Drag or keyboard moves, announced — the host writes.
- Inline cell editing in Reka UI — Native editors in the cell; every write goes through your handler.
- Row grouping in Reka UI — Drag, select or keyboard grouping, with totals in the headers.
- Aggregation in Reka UI — Footer totals, pinned summaries, group aggregates — not data rows.
- Nested tables in Reka UI — A real table under a row — same engine, own columns, own keys.
- CSV export in Reka UI — One toolbar button, a CSV of the table as it stands.
- Row and column virtualization in Reka UI — 40,000 rows in a scroll box, only the visible ones rendered.
- Tree data in Reka UI — Nesting, chevrons, lazy children, and a tree on phones.
- Mobile cards in Reka UI — Every row becomes a card on phones. Automatically, with the same state.
- Pivot tables in Reka UI — Rows down the side, dimensions across the top, subtotals at every level.
- Saved views in Reka UI — Name an arrangement and restore it from the menu.
- Spreadsheet formulas in Reka UI — ROUND, POWER, SQRT, IF — computed columns, errors in the cell.
- Right-to-left Reka UI data table — Arabic strings, a flipped axis, and a popover that opens from the right edge.
- Live updates in Reka UI — Rows change while you read them. Sort and selection hold.
- Accessible Reka UI data table — Arrow-key focus, a visible ring, forced-colors, and live announcements.
Reference: ai-http, ai-integrations, ai, agent-capabilities. More of this kit: AdaptTable for Reka UI, or the live demo.