DynamicCard
DynamicCard fetches card datasets from a remote endpoint and renders them in responsive CSS grid arrangements. Each card displays key/value data items with automated loading skeletons and pagination controls.
Props & Configuration
6 propsComplete property specifications, parameter types, and default fallbacks.
| Property | Type | Default | Description |
|---|---|---|---|
| apiDataRequired | ApiDataType | — | Remote endpoint configuration containing apiUrl and apiType. |
| filterKeyRequired | string | — | Unique filter key for grid filter synchronization. |
| refreshTrigger | number | 0 | Increment to trigger immediate data re-fetch. |
| pageSize | number | 12 | Number of cards displayed per page. |
| className | string | — | Wrapper container class name. |
| gridClassName | string | "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4" | CSS Grid class name controlling column responsive breakpoints. |
Interactive Examples & Live Previews
2 DemosEvery example includes its own live, interactive preview element alongside the corresponding copyable TypeScript snippet.
Basic Product Card Grid
Remote cards layout fetching item specifications from an API.
Project Alpha (Mobile Client)
ACTIVEAuthentication Service v2
PENDINGCloud Infrastructure Migration
ACTIVE1import React from "react";2import { DynamicCard } from "antd-dynamic-ui";34export default function BasicCards() {5 return (6 <div className="p-6">7 <h2 className="text-xl font-bold mb-4">Inventory Products</h2>8 <DynamicCard9 apiData={{ apiUrl: "/api/v1/inventory", apiType: "get" }}10 filterKey="inventory_cards"11 pageSize={6}12 />13 </div>14 );15}
Custom Responsive Grid Breakpoints
Card grid with 4-column layout on wide screens and refresh counter.
Project Alpha (Mobile Client)
ACTIVEAuthentication Service v2
PENDINGCloud Infrastructure Migration
ACTIVE1import React, { useState } from "react";2import { DynamicCard, DynamicHeader } from "antd-dynamic-ui";34export default function CompleteCardGrid() {5 const [refresh, setRefresh] = useState(0);67 return (8 <div className="space-y-4 p-6">9 <DynamicHeader10 filterKey="device_fleet_cards"11 title="IoT Device Fleet"12 onRefresh={() => setRefresh((c) => c + 1)}13 />14 <DynamicCard15 apiData={{ apiUrl: "/api/v1/devices", apiType: "get" }}16 filterKey="device_fleet_cards"17 gridClassName="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6"18 pageSize={12}19 refreshTrigger={refresh}20 />21 </div>22 );23}
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": "Fetched cards",
"data": {
"rows": [
{
"title": "Server Node US-East-1",
"info": [
{
"key": "CPU Load",
"value": "42%"
},
{
"key": "Memory",
"value": "16 GB / 32 GB"
},
{
"key": "Status",
"value": "Healthy"
}
]
}
],
"totalRows": 1
}
}Frequently Asked Questions & Quick Solutions
Architectural patterns, React 19 compatibility, and integration tips for DynamicCard.
How does DynamicCard integrate with Ant Design 5.x and Next.js 15?▼
DynamicCard 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 DynamicCard?▼
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.