Core Dynamic ComponentsFlagship Data Grid

DynamicTable

DynamicTable is the core data presentation component of antd-dynamic-ui. Instead of declaring repetitive JSX Column tags, you supply a declarative JSON schema. DynamicTable natively supports 8 composite cell types (IMAGE, LINK, TEXT, STATUS, DYNAMIC_FORM, ACTION, MODAL, CUSTOM), adaptive virtualization threshold (>50 rows) for 60fps scrolling, server-side pagination (offset and cursor), and seamless integration with FilterDrawer, ColumnDrawer, and DownloadModal.

Adaptive 60fps virtual scrolling for 100,000+ records with automatic DOM node recycling
8 Discriminated Union Composite Cell Types: IMAGE, LINK, TEXT, STATUS, DYNAMIC_FORM, ACTION, MODAL, CUSTOM
Dual Server-Side Pagination Models: Standard offset-limit and scalable cursor-based pagination
Zero Layout Thrashing: requestAnimationFrame-throttled ResizeObserver with height memory
Synchronized with useGridFilters for automated search, sorting, and multi-parameter filtering
Built-in ColumnDrawer for drag-and-drop column reordering and visibility toggling
Built-in DownloadModal with instant CSV and Excel XLSX export

Props & Configuration

8 props

Complete property specifications, parameter types, and default fallbacks.

PropertyTypeDefaultDescription
apiDataRequiredApiDataType—Remote endpoint configuration containing apiUrl, apiType ('get' | 'post'), default params, and body.
filterKeyRequiredstring—Unique identifier connecting this table to Zustand filter state and DynamicHeader / FilterDrawer.
paginationType"offset" | "cursor""offset"Controls whether pagination sends page/limit or nextCursor tokens.
borderbooleantrueToggles outer container border and subtle row divider lines.
refreshTriggernumber0Incrementing numeric counter that forces the table to re-query the remote API immediately.
onActionClick(data: { actionKey: string; record: any }) => void—Callback triggered whenever an ACTION cell, row menu item, or button is clicked.
classNamestring—Custom CSS class for the outermost table container.
rowKeystring | ((record: any) => string)"id"Unique key field identifier for rows (defaults to 'id').

Interactive Examples & Live Previews

3 Demos

Every example includes its own live, interactive preview element alongside the corresponding copyable TypeScript snippet.

Example 1

Basic Remote API Grid

Quickstart configuration connecting DynamicTable to a paginated REST endpoint.

Live Interactive Demo
Live Interactive Grid
4 live records
ID
User ProfileRole & AccessAccount StatusJoined Date
101
Alexander Wright
alex.wright@corp.io
Superadmin
Active
2026-01-15
102
Sophia Martinez
sophia.m@corp.io
Product Mgr
Active
2026-02-01
103
Marcus Chen
m.chen@corp.io
Developer
Pending
2026-02-14
104
Emma Watson
emma.w@corp.io
Designer
Suspended
2026-03-02
  • Showing 1 to 4 of 4 entries
  • 1
DynamicTable.basic.tsxtsx
1import React from "react";
2import { DynamicTable } from "antd-dynamic-ui";
3
4export default function OrdersTable() {
5 return (
6 <div className="p-6">
7 <h2 className="text-xl font-bold mb-4">Customer Orders</h2>
8 <DynamicTable
9 apiData={{
10 apiUrl: "/api/v1/orders",
11 apiType: "get",
12 params: { department: "logistics" },
13 }}
14 filterKey="orders_grid"
15 border={true}
16 onActionClick={(action) => {
17 console.log("User clicked row action:", action);
18 }}
19 />
20 </div>
21 );
22}
Example 2

Complete Props & Composite Cells

Enterprise setup utilizing cursor pagination, refresh counter, action event delegation, and all props.

Live Interactive Demo
Enterprise Directory GridrefreshTrigger: 0
ID
User ProfileRole & AccessAccount StatusJoined DateQuick Actions
101
Alexander Wright
alex.wright@corp.io
Superadmin
Active
2026-01-15
102
Sophia Martinez
sophia.m@corp.io
Product Mgr
Active
2026-02-01
103
Marcus Chen
m.chen@corp.io
Developer
Pending
2026-02-14
104
Emma Watson
emma.w@corp.io
Designer
Suspended
2026-03-02
  • Showing 1 to 4 of 4 entries
  • 1
DynamicTable.complete.tsxtsx
1import React, { useState } from "react";
2import { DynamicTable, DynamicHeader } from "antd-dynamic-ui";
3import { message, Modal } from "antd";
4
5export default function EnterpriseUsersGrid() {
6 const [refreshCount, setRefreshCount] = useState(0);
7
8 const handleActionClick = (actionData: any) => {
9 const { actionKey, record } = actionData;
10 if (actionKey === "DELETE_USER") {
11 Modal.confirm({
12 title: "Delete User",
13 content: `Are you sure you want to delete ${record?.name}?`,
14 onOk: async () => {
15 message.success("User deleted successfully");
16 setRefreshCount((prev) => prev + 1); // Triggers table reload
17 },
18 });
19 } else if (actionKey === "VIEW_PROFILE") {
20 window.location.href = `/users/${record?.id}`;
21 }
22 };
23
24 return (
25 <div className="space-y-4">
26 {/* DynamicHeader automatically syncs search & refresh with filterKey */}
27 <DynamicHeader
28 filterKey="enterprise_users_grid"
29 title="Enterprise Accounts"
30 subTitles={["System Administration", "Active Tenants"]}
31 searchPlaceholder="Search accounts by name, email, or domain..."
32 onRefresh={() => setRefreshCount((c) => c + 1)}
33 />
34
35 <DynamicTable
36 apiData={{
37 apiUrl: "/api/v2/tenants/directory",
38 apiType: "post",
39 body: { region: "us-east-1", activeOnly: true },
40 }}
41 filterKey="enterprise_users_grid"
42 paginationType="cursor"
43 border={true}
44 refreshTrigger={refreshCount}
45 onActionClick={handleActionClick}
46 className="shadow-sm rounded-xl"
47 />
48 </div>
49 );
50}
Example 3

StaticTable with In-Memory Mock Data

Using StaticTable for zero-network testing, offline storybooks, and local mock datasets.

Live Interactive Demo
In-Memory Mock Dataset
4 mocked records
IDMemberRoleStatus
001
Sarah Connor
sarah@resistance.org
Commander
Active
002
John Doe
john@tech.io
Engineer
Active
  • Showing 1 to 2 of 2 entries
  • 1
StaticTable.offline.tsxtsx
1import React from "react";
2import { StaticTable, TableColumnType, TableDataType } from "antd-dynamic-ui";
3
4const MOCK_COLUMNS: TableColumnType[] = [
5 { id: "id", title: "ID", width: 80, sortable: true },
6 { id: "user", title: "User Profile", minWidth: 200 },
7 { id: "role", title: "Access Role", width: 140 },
8 { id: "status", title: "Account Status", width: 130 },
9];
10
11const MOCK_DATA: TableDataType = {
12 columns: MOCK_COLUMNS,
13 rows: [
14 {
15 id: [{ type: "TEXT", title: "101", isBold: true }],
16 user: [
17 { type: "IMAGE", src: "https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=100", width: 36, height: 36, shape: "circle", isPreview: true },
18 { type: "TEXT", title: "Alexander Wright", subTitle: "alex@corp.io", isBold: true },
19 ],
20 role: [{ type: "STATUS", title: "Superadmin", bgColor: "#eff6ff", textColor: "#1d4ed8" }],
21 status: [{ type: "STATUS", title: "Active", bgColor: "#ecfdf5", textColor: "#047857" }],
22 },
23 ],
24 features: { search: true, sort: true, export: true, refresh: true, columnToggle: true },
25 isPaginated: true,
26 pageNumber: 1,
27 pageSize: 10,
28 totalPages: 1,
29 totalRows: 1,
30 count: 1,
31};
32
33export default function OfflineTableDemo() {
34 return (
35 <StaticTable
36 staticData={MOCK_DATA}
37 border={true}
38 pagination={true}
39 filterKey="offline_demo"
40 onActionClick={(action) => alert(JSON.stringify(action))}
41 />
42 );
43}

Expected Backend API Response Schema

Ensure your backend endpoint returns JSON matching this exact structure to prevent hydration and rendering errors.

Expected API Response Payload

Your backend API must return JSON matching this exact structure.

{
  "success": true,
  "message": "Data retrieved successfully",
  "data": {
    "columns": [
      {
        "id": "id",
        "title": "ID",
        "width": 80,
        "sortable": true
      },
      {
        "id": "user",
        "title": "User Profile",
        "minWidth": 200
      },
      {
        "id": "role",
        "title": "Role",
        "width": 140
      },
      {
        "id": "status",
        "title": "Status",
        "width": 130
      }
    ],
    "rows": [
      {
        "id": [
          {
            "type": "TEXT",
            "title": "101",
            "isBold": true
          }
        ],
        "user": [
          {
            "type": "TEXT",
            "title": "Alexander Wright",
            "subTitle": "alex@corp.io"
          }
        ],
        "role": [
          {
            "type": "STATUS",
            "title": "Superadmin",
            "bgColor": "#eff6ff",
            "textColor": "#1d4ed8"
          }
        ],
        "status": [
          {
            "type": "STATUS",
            "title": "Active",
            "bgColor": "#ecfdf5",
            "textColor": "#047857"
          }
        ]
      }
    ],
    "features": {
      "search": true,
      "sort": true,
      "export": true,
      "refresh": true,
      "columnToggle": true
    },
    "isPaginated": true,
    "pageNumber": 1,
    "pageSize": 10,
    "totalPages": 1,
    "totalRows": 1,
    "count": 1
  }
}

Frequently Asked Questions & Quick Solutions

Architectural patterns, React 19 compatibility, and integration tips for DynamicTable.

How does DynamicTable integrate with Ant Design 5.x and Next.js 15?▼

DynamicTable is designed as an enhanced, declarative wrapper for Ant Design. It fully supports Next.js 15 App Router when using @ant-design/nextjs-registry, eliminating SSR hydration mismatches and guaranteeing 0ms layout thrashing.

Can I customize validation, themes, and props for DynamicTable?▼

Yes. Every prop is fully typed in TypeScript 5 with comprehensive Intellisense. You can pass custom styling via className or style props, configure global Ant Design themes via ConfigProvider, and extend validation logic seamlessly.