Ant Design data display
Version baseline: Ant Design 6.x (6.4.3 current stable at this review), with the current v6 documentation and React 18 or 19 compatibility; prefer React 19 for new work. Inspect the exact installed patch and migration notes before changing an existing project.
Design the state model before choosing the component. A useful data display explains loading, empty, error, partial, and success states without making the user infer what happened.
Choose a component
- Use
Cardfor a bounded content region with a clear title or actions. - Use
Descriptionsfor labeled fields on one entity; use a form when the fields are editable. - Use
Listfor repeated records or activity; useTablewhen scanning columns, sorting, filtering, or pagination matters. - Use
Statisticfor a small number with context and a trend or suffix. - Use
Tag,Badge, orAvatarfor compact status and identity, with text or accessible labels when color is not enough. - Use
SkeletonorSpinduring loading,Emptyfor a valid no-data result, andResultor an inlineAlertfor failure or a completed outcome.
Workflow
- Define the primary question the component answers and the minimum data needed to answer it.
- Pick a hierarchy: page heading, region heading, primary value, supporting metadata, then actions.
- Give each state a deliberate rendering path. Preserve the surrounding layout when a single card fails so one request does not erase unrelated content.
- Format dates, numbers, and statuses consistently. Do not encode meaning only with color or icon shape.
- Keep labels short, truncate only when the full value remains accessible, and provide responsive behavior for long names and translated text.
- Verify real data, zero values, null values, long content, loading, errors, and narrow widths.
<Card title="Account health" extra={<Link href="/account">View</Link>}>
<Statistic title="Active users" value={activeUsers} suffix="this month" />
<Space className="mt-4">
<Badge status={healthy ? "success" : "warning"} text={healthy ? "Healthy" : "Review"} />
<Tag color={healthy ? "green" : "gold"}>{planName}</Tag>
</Space>
</Card>
Review traps
- Do not render
0as an empty state or hide a valid zero behind a falsy check. - Do not show a spinner forever when the request has failed; expose retry or next action.
- Keep card actions aligned and predictable; avoid turning an entire card into an unlabeled click target.
- Use
Tablefor dense comparison instead of forcing aListto imitate a table.