AdaptTable for MUI
AI table assistant in MUI
@adapttable/ai is optional and provider-neutral. This MUI demo combines a conversational assistant with a real table. Try filtering, grouping, column pinning and a proposed edit; available actions depend on the mounted features and the host's permissions. Row pinning requires an ungrouped view in this demo.
Start in Simulated mode: suggested prompts run deterministic local scenarios, not a language model. The conversation shows action receipts; a proposed write still follows approval and save policy. Connect backend sends your prompt and permitted table context to an endpoint you run. The assistant keeps the same table session and MUI controls in both modes.
Three integration levels share that session: a custom bridge that maps any agent format onto session.execute, an AgentEnvelope on your transport, and optional JSON, OpenAI, MCP or HTTP helpers from your own runtime. Execution never requires another model call.
The optional assistant uses MUI controls alongside the Material table and approval strip. Its separate import keeps chat UI out of tables that do not need it.
The code
import { useTableAssistant } from "@adapttable/ai-react";
import { assistantHttpTransport } from "@adapttable/ai/http";
import { tableAgent } from "@adapttable/ai-react";
import { DataTable, agentApproval } from "@adapttable/mui";
import { TableAssistant } from "@adapttable/mui/assistant";
import { editing } from "@adapttable/mui/editing";
import { filters } from "@adapttable/mui/filters";
import { useMemo, useState } from "react";
const suggestions = [
{
id: "core-team",
title: "Show only the Core team",
prompt: "Show only the Core team.",
requires: ["view.setFilters"],
},
];
export function Orders({ rows, columns, onEdit }) {
const [session, setSession] = useState();
const transport = useMemo(
() => assistantHttpTransport({ endpoint: "/api/table-agent" }),
[]
);
const assistant = useTableAssistant({ session, transport, suggestions });
return (
<>
<DataTable
data={rows}
columns={columns}
rowKey={(row) => row.id}
features={[
filters([{ key: "team", type: "multiSelect", getValue: (row) => row.team }]),
agentApproval(),
editing(onEdit),
tableAgent({
tableId: "orders",
writePolicy: "allow",
approval: "writes",
commit: "stage",
columns: { salary: { type: "number", writable: true } },
bridge: { attach: setSession },
}),
]}
/>
<TableAssistant
assistant={assistant}
open={assistant.open}
onOpenChange={assistant.setOpen}
/>
</>
);
}
Install
pnpm add @adapttable/mui @adapttable/core @mui/material
The same feature in the other kits
- AI table assistant in Mantine — Rounded, friendly, filled controls
- AI table assistant in Chakra — Soft teal, generous radius
- AI table assistant in Ant Design — Compact, tinted header, crisp
- AI table assistant in Radix — Radix Themes, iris accent
- AI table assistant in Base UI — Unstyled primitives, blue accent
- AI table assistant in shadcn — Monochrome, ring focus
- AI table assistant in Tailwind — Unstyled — your own classes
More MUI features
- Filtering in MUI — Operators, an AND/OR tree, chips, and find in the same URL.
- Column management in MUI — Show, hide, reorder, pin and resize — from a menu you did not write.
- Column groups in MUI — Spanning headers that collapse to a stub, a kept child, or a custom cell.
- Row selection in MUI — A set of ids that survives paging, with bulk actions over it.
- Rows in MUI — Pin rows, merge cells, and a 3-dot menu for add and delete.
- Row reordering in MUI — Flat, grouped and tree moves — keyboard, confirm, host writes.
- Inline cell editing in MUI — Kit-native editors in the cell; every write goes through your handler.
- Row grouping in MUI — Drag, keyboard and mobile grouping controls with live aggregation overrides.
- Aggregation in MUI — Footer totals, pinned summaries, group aggregates — not data rows.
- Nested tables in MUI — A real table under a row — same engine, own columns, own keys.
- Export and print in MUI — Browser files or cancellable server jobs — CSV, XLSX and PDF.
- Row and column virtualization in MUI — 100k rows, 40 columns, virtualized rows and columns, sticky chrome.
- Tree data in MUI — Nesting, chevrons, URL expansion, and host-owned tree moves.
- Mobile cards in MUI — Every row becomes a card on phones. Automatically, with the same state.
- Pivot tables in MUI — Rows down the side, dimensions across the top, subtotals at every level.
- Saved views in MUI — Name an arrangement, share it as a link, manage the list in place.
- Spreadsheet formulas in MUI — ROUND, POWER, SQRT, IF — computed columns, errors in the cell.
- Right-to-left MUI data table — Arabic strings, a flipped axis, and a popover that opens from the right edge.
- Live updates in MUI — Rows change while you read them. Sort and selection hold.
- Accessible MUI 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 MUI, or the live demo.