Dashboards
A dashboard shows each role its to-do list and a few key numbers at a glance, built with StatRow, ProCard, ProList, and @ant-design/charts.
This is the first page after sign-in. An approver needs to know how many requests wait for them and which are close to due; a staff member needs to know where their own requests stand. Every number gets a secondary line, and the to-do list is the main part.
// Approver dashboard: StatisticCard.Group (each number with a sub-line) + to-do list (Listy) + donut chart.
import { PageContainer, ProCard, StatisticCard } from "@ant-design/pro-components";
import { Avatar, Button, Col, Flex, Grid, Listy, Row, Space, Typography, theme } from "antd";
import { ClockCircleOutlined, RightOutlined } from "@ant-design/icons";
import { Pie } from "@ant-design/charts";
/** Mock people get a face (manh.run avatars 01–24), the same one for the same name. */
const face = (name: string) => {
let h = 0;
for (const ch of name) h = (h * 31 + ch.charCodeAt(0)) >>> 0;
return `https://manh.run/avatars/${String((h % 24) + 1).padStart(2, "0")}.svg`;
};
const { Statistic } = StatisticCard;
const usd = (n: number) => n.toLocaleString("en-US", { style: "currency", currency: "USD", maximumFractionDigits: 0 });
const todo = [
{ id: 10, title: "Fix the AC in the 3rd-floor meeting room", who: "Laura Bennett · Operations", due: "Nov 8 · overdue", late: true, amount: 450 },
{ id: 9, title: "Renew Microsoft 365 (12 months)", who: "Laura Bennett · Operations", due: "Nov 13", late: false, amount: 1500 },
{ id: 8, title: "2× Dell P2423 monitors", who: "Michael Carter · Engineering", due: "Nov 15", late: false, amount: 520 },
];
export default function Page() {
const { token } = theme.useToken();
const md = Grid.useBreakpoint().md;
return (
<PageContainer title="Good afternoon, Hannah Reed" subTitle="3 requests are waiting for your approval"
extra={<Button type="primary">Open approvals <RightOutlined /></Button>}>
{/* Cards share one left/right edge: Flex for the vertical rhythm, Row/Col for columns (not ProCard gutter). */}
<Flex vertical gap={16}>
<StatisticCard.Group direction={md ? "row" : "column"}>
<StatisticCard statistic={{ title: "Awaiting approval", value: 3, description: <Statistic title="Value" value={usd(2470)} /> }} />
<StatisticCard.Divider type={md ? "vertical" : "horizontal"} />
<StatisticCard statistic={{ title: "Approved this month", value: 9640, formatter: (v) => usd(Number(v)), description: <Statistic title="vs last month" value="up 12%" /> }} />
<StatisticCard.Divider type={md ? "vertical" : "horizontal"} />
<StatisticCard statistic={{ title: "Rejected this month", value: 1, description: <Statistic title="Total requests" value={8} /> }} />
</StatisticCard.Group>
<Row gutter={[16, 16]}>
<Col xs={24} lg={15}>
<ProCard title="Needs my approval" subTitle="soonest first" extra={<a>View all</a>} headerBordered style={{ height: "100%" }}>
<Listy
rowKey="id"
items={todo}
rowHoverable={false}
itemRender={(r) => (
<div className="flex items-start gap-3">
<Avatar className="shrink-0" src={face(r.who)} alt={r.who} />
<div className="min-w-0 flex-1">
<div className="font-medium">{r.title}</div>
<Space size={12} className="text-fg-secondary"><span>{r.who}</span><Typography.Text type={r.late ? "danger" : "secondary"}><ClockCircleOutlined /> {r.due}</Typography.Text></Space>
</div>
<b className="shrink-0">{usd(r.amount)}</b>
</div>
)}
/>
</ProCard>
</Col>
<Col xs={24} lg={9}>
<ProCard title="Approved this month" subTitle="by category" headerBordered style={{ height: "100%" }}>
<Pie
height={260}
data={[{ type: "Equipment", value: 3980 }, { type: "Office supplies", value: 1910 }, { type: "Services", value: 3750 }]}
angleField="value"
colorField="type"
innerRadius={0.62}
label={false}
legend={{ color: { position: "bottom", layout: { justifyContent: "center" } } }}
tooltip={{ items: [{ field: "value", valueFormatter: (v: number) => usd(v) }] }}
/>
</ProCard>
</Col>
</Row>
</Flex>
</PageContainer>
);
}
Build the "Dashboard" screen for my app following the Manh UI playbook (framework_docs("pro")): Approver dashboard: StatisticCard.Group (each number with a sub-line) + a to-do list (ProList) + a donut chart. Data comes from the app's API through useApiClient(); labels and fields follow my spec.Page layout
The page stacks sections vertically, all on one left edge and one right edge:
PageContainer greeting · pending count · one primary button
└── Flex vertical gap={16}
├── StatRow 3–4 KPIs, each with a secondary line
└── Row gutter={[16, 16]}
├── Col lg={15} ProCard "Waiting for me" → ProList
└── Col lg={9} ProCard "By category" → PieA header that names the work
title is a greeting, subTitle is the number of items waiting, and extra is one button that leads to them.
<PageContainer
title={`Good morning, ${user.name}`}
subTitle={manager ? `${s?.pending ?? "…"} requests are waiting for your approval` : "Your purchase requests"}
extra={<Button type="primary" onClick={() => nav("/requests")}>Open approvals</Button>}
>
{/* … */}
</PageContainer>A KPI row with secondary lines
StatRow from manh/shell shows one number per tile, four across on a desktop and 2 × 2 on a phone. description is the secondary line: the change against the last period, an amount or a count. A bare number looks unfinished.
<StatRow loading={!s} items={[
{ title: "Pending approval", value: s?.pending ?? 0, status: "processing",
description: `Worth ${vndShort(s?.pendingAmount ?? 0)}`, onClick: () => nav("/requests") },
{ title: "Approved this month", value: vndShort(cur),
description: "Up 12% on last month", chart: <Tiny.Area height={46} data={series} /> },
]} />- At most 3–4 numbers. More and the reader doesn’t know where to look.
onClicktakes the reader to the list behind the number. Items that arefalseornullare skipped, which helps for numbers only one role sees.
To-do list and chart side by side
Build columns with Row gutter + Col so the cards line up with the KPI row above. Sort the to-do list by nearest due date and color overdue items with danger.
<Row gutter={[16, 16]}>
<Col xs={24} lg={15}>
<ProCard title="Waiting for me" subTitle="nearest due first" headerBordered
extra={<a onClick={() => nav("/requests")}>View all</a>} style={{ height: "100%" }}>
<ProList<Request> rowKey="id" split dataSource={rows}
onItem={(r) => ({ onClick: () => nav(`/requests/${r.id}`) })}
locale={{ emptyText: <Empty description="No requests are waiting for approval." /> }}
metas={{
avatar: { render: (_, r) => <Avatar>{r.creatorName?.[0]}</Avatar> },
title: { dataIndex: "title" },
description: { render: (_, r) => <Space>{r.creatorName}<span>{CATEGORY[r.category]}</span><Due r={r} /></Space> },
actions: { render: (_, r) => [<b key="amt">{vnd(r.amount)}</b>] },
}} />
</ProCard>
</Col>
<Col xs={24} lg={9}>
<ProCard title="By category" headerBordered style={{ height: "100%" }}>
<Pie data={byCategory} angleField="value" colorField="type" innerRadius={0.62} label={false} height={280}
tooltip={{ items: [{ field: "value", valueFormatter: (v: number) => vnd(v) }] }} />
</ProCard>
</Col>
</Row>Pick a chart by question
- Trend over time →
Line/Area. - Compare categories →
Column/Bar. - Share of a whole, 6 parts at most →
PiewithinnerRadius. - Target against actual →
Progress/Gauge/Liquid. - Two measures on two scales →
DualAxes. - A small chart inside a KPI card →
Tiny.Area,Tiny.Column.
Put every chart in a titled ProCard, with units in the tooltip or axis labels.
Good to know
trend="up"is red and"down"is green (a Chinese market convention). For Vietnamese users, write it out (“up 12%”) or color it yourself with tokens.- Don’t use
ProCard gutterfor columns: the cards end up about 8px inside the KPI row. - Set
heightandautoFiton every chart so it fits its card.
Variants
Executive dashboard — a period picker that changes every number, a revenue and profit chart, channel share, best sellers, and low-stock alerts.
// Owner dashboard for a 3-channel furniture store: the period picker (today / 7 days / month / 12 months) drives every number; 4 KPIs vs the previous period, revenue vs gross profit chart, channel mix, best sellers, action items and low-stock alerts.
// In a real app: api.reports.summary({ period }) returns the KPIs + daily/monthly series; api.tasks.counts() and api.inventory.lowStock() replace the sample data.
import { useMemo, useState } from "react";
import { PageContainer, ProCard, StatisticCard } from "@ant-design/pro-components";
import { Badge, Button, Col, Flex, Progress, Row, Segmented, Table, Tooltip, Typography, theme, type TableProps } from "antd";
import { ArrowDownOutlined, ArrowUpOutlined, ClockCircleOutlined, DollarOutlined, DownloadOutlined, InboxOutlined, RightOutlined, CarOutlined } from "@ant-design/icons";
import { Column, Pie, Tiny } from "@ant-design/charts";
import dayjs, { type Dayjs } from "dayjs";
type Period = "today" | "7d" | "month" | "12m";
type Day = { date: Dayjs; rev: number[]; gp: number[]; orders: number[] };
const NOW = dayjs("2026-11-13T14:30:00");
const TODAY_SHARE = 0.58; // share of a typical day's revenue taken by 2:30 PM
const CHANNELS = [{ label: "Showroom", aov: 1460, margin: 0.41 }, { label: "Website", aov: 730, margin: 0.35 }, { label: "B2B projects", aov: 0, margin: 0.27 }];
const nf = new Intl.NumberFormat("en-US");
const vnd = (n: number) => `$${nf.format(Math.round(n))}`;
const num = (n: number, d: number) => new Intl.NumberFormat("en-US", { maximumFractionDigits: d }).format(n);
const short = (n: number) => (Math.abs(n) >= 1e6 ? `$${num(n / 1e6, 2)}M` : `$${num(n / 1e3, Math.abs(n) >= 1e5 ? 0 : 1)}k`);
const pct = (x: number) => `${new Intl.NumberFormat("en-US", { minimumFractionDigits: 1, maximumFractionDigits: 1 }).format(x * 100)}%`;
const sum = (a: number[]) => a.reduce((s, v) => s + v, 0);
// Sample data: 731 days of sales generated from a fixed seed (mulberry32) — same result on every render.
function rng(seed: number) {
return () => { seed = (seed + 0x6d2b79f5) | 0; let t = Math.imul(seed ^ (seed >>> 15), 1 | seed); t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t; return ((t ^ (t >>> 14)) >>> 0) / 4294967296; };
}
const DAYS: Day[] = (() => {
const r = rng(2026);
const round = (v: number) => Math.round(v / 10) * 10;
return Array.from({ length: 731 }, (_, i) => {
const date = NOW.startOf("day").subtract(730 - i, "day");
const k = (0.8 + (0.2 * i) / 730) * (i === 730 ? TODAY_SHARE : 1);
const weekend = date.day() === 0 || date.day() === 6 ? 1.55 : 1;
const rev = [round(7600 * k * weekend * (0.75 + 0.5 * r())), round(3500 * k * (0.7 + 0.6 * r())), r() < 0.22 ? round((9.5 + 35 * r()) * 1e3 * k) : 0];
const gp = rev.map((v, c) => round(v * (CHANNELS[c].margin + (r() - 0.5) * 0.04)));
const orders = [Math.max(1, Math.round(rev[0] / CHANNELS[0].aov)), Math.max(1, Math.round(rev[1] / CHANNELS[1].aov)), rev[2] ? 1 : 0];
return { date, rev, gp, orders };
});
})();
const between = (a: Dayjs, b: Dayjs) => DAYS.filter((d) => !d.date.isBefore(a, "day") && !d.date.isAfter(b, "day"));
const scale = (d: Day, k: number): Day => ({ ...d, rev: d.rev.map((v) => v * k), gp: d.gp.map((v) => v * k), orders: d.orders.map((v) => Math.round(v * k)) });
const total = (days: Day[]) => ({
rev: [0, 1, 2].map((c) => sum(days.map((d) => d.rev[c]))),
gp: [0, 1, 2].map((c) => sum(days.map((d) => d.gp[c]))),
orders: [0, 1, 2].map((c) => sum(days.map((d) => d.orders[c]))),
});
const HOURS = [8, 9, 10, 11, 12, 13, 14];
const HOUR_W = [0.06, 0.12, 0.16, 0.18, 0.14, 0.17, 0.17];
function buildPeriod(p: Period) {
const t = NOW.startOf("day");
const [cur, prev, prevLabel] =
p === "today" ? [between(t, t), between(t.subtract(1, "day"), t.subtract(1, "day")).map((d) => scale(d, TODAY_SHARE)), "same time yesterday"]
: p === "7d" ? [between(t.subtract(6, "day"), t), between(t.subtract(13, "day"), t.subtract(7, "day")), "the previous 7 days"]
: p === "month" ? [between(t.startOf("month"), t), between(t.subtract(1, "month").startOf("month"), t.subtract(1, "month")), `the same days of ${t.subtract(1, "month").format("MMMM")}`]
: [between(t.subtract(11, "month").startOf("month"), t), between(t.subtract(23, "month").startOf("month"), t.subtract(12, "month")), "the previous 12 months"];
// Chart columns: by hour (today), by day (7 days, this month), by month (12 months).
const groups = new Map<string, Day[]>();
if (p === "today") HOURS.forEach((h, i) => groups.set(h > 12 ? `${h - 12} PM` : h === 12 ? "12 PM" : `${h} AM`, [scale(cur[0], HOUR_W[i])]));
else cur.forEach((d) => { const key = d.date.format(p === "12m" ? "MMM YY" : "MMM D"); groups.set(key, [...(groups.get(key) ?? []), d]); });
const buckets = [...groups].map(([label, days]) => ({ label, ...total(days) }));
// Open orders: orders from the period not yet delivered, split by order age.
const status = [0, 0, 0];
cur.forEach((d) => {
const age = t.diff(d.date, "day");
d.orders.forEach((n, c) => {
const open = Math.round(n * (age === 0 ? 0.9 : age <= 6 ? 0.55 : age <= 20 ? 0.18 : c === 2 && age <= 60 ? 0.4 : 0));
status[age === 0 ? 0 : age <= 6 ? 1 : 2] += open;
});
});
return { cur: total(cur), prev: total(prev), prevLabel, buckets, status };
}
const PRODUCTS = [
{ name: "Milano 3-seat leather sofa", price: 3490, share: [0.16, 0.08, 0.02] },
{ name: "Oslo oak dining set, 6 chairs", price: 2190, share: [0.12, 0.07, 0.03] },
{ name: "Kyoto walnut bed, king", price: 2690, share: [0.11, 0.06, 0.02] },
{ name: "ErgoPro ergonomic chair", price: 649, share: [0.03, 0.12, 0.1] },
{ name: "Flex 55\" standing desk", price: 899, share: [0.03, 0.09, 0.14] },
{ name: "Mesh office chair", price: 329, share: [0.01, 0.04, 0.22] },
{ name: "Nordic 4-door wardrobe", price: 1590, share: [0.08, 0.05, 0.04] },
];
type Stock = { sku: string; name: string; warehouse: string; onHand: number; min: number; incoming: number; eta?: string; perDay: number };
const STOCK: Stock[] = [
{ sku: "SF-MIL3-GR", name: "Milano 3-seat leather sofa · grey", warehouse: "Austin showroom", onHand: 0, min: 3, incoming: 4, eta: "Nov 25", perDay: 0.4 },
{ sku: "GVP-MESH-BK", name: "Mesh office chair · black", warehouse: "Round Rock warehouse", onHand: 18, min: 60, incoming: 120, eta: "Nov 20", perDay: 7.5 },
{ sku: "BNH-FLX14-WH", name: "Flex 55\" standing desk · white", warehouse: "Round Rock warehouse", onHand: 6, min: 15, incoming: 0, perDay: 1.6 },
{ sku: "GCT-ERGO-BK", name: "ErgoPro ergonomic chair", warehouse: "Round Rock warehouse", onHand: 9, min: 20, incoming: 40, eta: "Nov 18", perDay: 2.1 },
{ sku: "KTV-WAL20", name: "Walnut TV console, 79\"", warehouse: "Austin showroom", onHand: 4, min: 5, incoming: 0, perDay: 0.3 },
];
const DEBTS = [29_500, 22_600, 13_300]; // 3 B2B customers past their payment due date
const STATUS_LABELS = ["Awaiting confirmation", "Being prepared", "Out for delivery & install"];
export default function Page() {
const { token } = theme.useToken();
const [period, setPeriod] = useState<Period>("month");
const d = useMemo(() => buildPeriod(period), [period]);
const rev = sum(d.cur.rev), prevRev = sum(d.prev.rev), gp = sum(d.cur.gp), prevGp = sum(d.prev.gp);
const orders = sum(d.cur.orders), prevOrders = sum(d.prev.orders);
const margin = gp / rev, prevMargin = prevGp / prevRev;
const open = sum(d.status);
const chColors = [token.colorPrimary, token.cyan, token.gold];
const stColors = [token.colorWarning, token.colorPrimary, token.colorSuccess];
const unit = period === "today" ? "hour" : period === "12m" ? "month" : "day";
const delta = (x: number, text: string) => (
<Typography.Text style={{ color: x >= 0 ? token.colorSuccess : token.colorError }}>
{x >= 0 ? <ArrowUpOutlined /> : <ArrowDownOutlined />} {text} <Typography.Text type="secondary">vs {d.prevLabel}</Typography.Text>
</Typography.Text>
);
const spark = (data: number[]) => (
<Tiny.Area height={44} data={data.map((value, index) => ({ index, value }))} xField="index" yField="value" shapeField="smooth"
style={{ fill: token.colorPrimary, fillOpacity: 0.18 }} />
);
const top = PRODUCTS.map((p) => {
const value = sum(p.share.map((s, c) => s * d.cur.rev[c]));
return { ...p, value, units: Math.max(1, Math.round(value / p.price)) };
}).sort((a, b) => b.value - a.value).slice(0, 6);
const tasks = [
{ icon: <ClockCircleOutlined />, title: "Orders unconfirmed for over 2 hours", note: "Oldest 5 h 10 min · 3 website orders", count: 4, color: token.colorWarning },
{ icon: <CarOutlined />, title: "Late deliveries", note: "2 showroom orders · 1 B2B project", count: 3, color: token.colorError },
{ icon: <InboxOutlined />, title: "Items below minimum stock", note: `${STOCK.filter((s) => s.onHand === 0).length} SKU out of stock`, count: STOCK.length, color: token.colorWarning },
{ icon: <DollarOutlined />, title: "Overdue B2B invoices", note: `${vnd(sum(DEBTS))} · oldest 34 days overdue`, count: DEBTS.length, color: token.colorError },
];
const stockCols: TableProps<Stock>["columns"] = [
{ title: "Product", dataIndex: "name", render: (_, r) => <Flex vertical><Typography.Link>{r.name}</Typography.Link><Typography.Text type="secondary" style={{ fontSize: 12 }}>{r.sku} · {r.warehouse}</Typography.Text></Flex> },
{ title: "Status", key: "st", width: 140, render: (_, r) => <Badge status={r.onHand === 0 ? "error" : "warning"} text={r.onHand === 0 ? "Out of stock" : "Below minimum"} /> },
{ title: "On hand / min", key: "qty", align: "right", width: 130, render: (_, r) => <span><b>{r.onHand}</b> / {r.min}</span> },
{ title: "Cover", key: "days", align: "right", width: 100, render: (_, r) => (r.onHand === 0 ? "—" : `${Math.floor(r.onHand / r.perDay)} days`) },
{ title: "Incoming", key: "in", width: 150, render: (_, r) => (r.incoming ? `${r.incoming} units · ${r.eta}` : <Typography.Text type="danger">Not ordered</Typography.Text>) },
{ title: "", key: "act", width: 130, align: "right", render: (_, r) => <Button size="small">{r.incoming ? "View PO" : "Create PO"}</Button> },
];
return (
<PageContainer
title="Good afternoon, Tom"
subTitle={`Oak & Anchor Home · figures as of ${NOW.format("h:mm A")}, Friday ${NOW.format("MMM D, YYYY")}`}
extra={[
<Segmented<Period> key="p" value={period} onChange={setPeriod}
options={[{ label: "Today", value: "today" }, { label: "7 days", value: "7d" }, { label: "This month", value: "month" }, { label: "12 months", value: "12m" }]} />,
<Button key="x" icon={<DownloadOutlined />}>Export report</Button>,
]}
>
<Flex vertical gap={16}>
<Row gutter={[16, 16]}>
<Col xs={24} sm={12} xl={6}>
<StatisticCard style={{ height: "100%" }} chart={spark(d.buckets.map((b) => sum(b.rev)))}
statistic={{ title: "Revenue", value: rev, formatter: () => <Tooltip title={vnd(rev)}>{short(rev)}</Tooltip>, description: delta(rev / prevRev - 1, pct(Math.abs(rev / prevRev - 1))) }}
footer={<Typography.Text type="secondary">Gross profit {short(gp)}</Typography.Text>} />
</Col>
<Col xs={24} sm={12} xl={6}>
<StatisticCard style={{ height: "100%" }} chart={spark(d.buckets.map((b) => sum(b.orders)))}
statistic={{ title: "New orders", value: orders, formatter: () => nf.format(orders), description: delta(orders / prevOrders - 1, pct(Math.abs(orders / prevOrders - 1))) }}
footer={<Typography.Text type="secondary">Average order {short(rev / Math.max(1, orders))}</Typography.Text>} />
</Col>
<Col xs={24} sm={12} xl={6}>
<StatisticCard style={{ height: "100%" }} chart={spark(d.buckets.map((b) => sum(b.gp) / Math.max(1, sum(b.rev))))}
statistic={{ title: "Gross margin", value: margin, formatter: () => pct(margin), description: delta(margin - prevMargin, `${num(Math.abs(margin - prevMargin) * 100, 1)} pts`) }}
footer={<Typography.Text type="secondary">Lowest, B2B: {pct(d.cur.gp[2] / Math.max(1, d.cur.rev[2]))}</Typography.Text>} />
</Col>
<Col xs={24} sm={12} xl={6}>
<StatisticCard style={{ height: "100%" }}
statistic={{ title: "Open orders", value: open, formatter: () => nf.format(open), description: <Typography.Text type="secondary">of {nf.format(orders)} orders this period</Typography.Text> }}
chart={
<Flex vertical gap={8} style={{ paddingTop: 8 }}>
<Flex style={{ height: 10, borderRadius: 5, overflow: "hidden", background: token.colorFillSecondary }}>
{d.status.map((n, i) => <Tooltip key={i} title={`${STATUS_LABELS[i]}: ${n}`}><div style={{ width: `${(n / Math.max(1, open)) * 100}%`, background: stColors[i] }} /></Tooltip>)}
</Flex>
{d.status.map((n, i) => (
<Flex key={i} justify="space-between" style={{ fontSize: 12 }}>
<Badge color={stColors[i]} text={STATUS_LABELS[i]} /><b>{n}</b>
</Flex>
))}
</Flex>
} />
</Col>
</Row>
<Row gutter={[16, 16]}>
<Col xs={24} lg={15}>
<ProCard title="Revenue and gross profit" subTitle={`by ${unit}`} headerBordered style={{ height: "100%" }}>
<Column height={300} data={d.buckets.flatMap((b) => [{ label: b.label, kind: "Revenue", value: sum(b.rev) }, { label: b.label, kind: "Gross profit", value: sum(b.gp) }])}
xField="label" yField="value" colorField="kind" group
scale={{ color: { range: [token.colorPrimary, token.colorSuccess] } }}
axis={{ y: { labelFormatter: (v: number) => short(v) } }}
legend={{ color: { position: "top", layout: { justifyContent: "flex-end" } } }}
tooltip={{ items: [{ channel: "y", valueFormatter: (v: number) => vnd(v) }] }} />
</ProCard>
</Col>
<Col xs={24} lg={9}>
<ProCard title="Needs attention" subTitle="updated 2:30 PM" headerBordered style={{ height: "100%" }} bodyStyle={{ padding: 8 }}>
<Flex vertical>
{tasks.map((t) => (
<a key={t.title} href="#" onClick={(e) => e.preventDefault()}
style={{ display: "flex", alignItems: "center", gap: 12, padding: "12px 12px", borderRadius: token.borderRadius, color: token.colorText, borderBottom: `1px solid ${token.colorSplit}` }}>
<span style={{ color: t.color, fontSize: 18 }}>{t.icon}</span>
<Flex vertical style={{ flex: 1, minWidth: 0 }}>
<Typography.Text strong>{t.title}</Typography.Text>
<Typography.Text type="secondary" style={{ fontSize: 12 }}>{t.note}</Typography.Text>
</Flex>
<Typography.Text strong style={{ fontSize: 20, color: t.color }}>{t.count}</Typography.Text>
<RightOutlined style={{ color: token.colorTextTertiary }} />
</a>
))}
</Flex>
</ProCard>
</Col>
</Row>
<Row gutter={[16, 16]}>
<Col xs={24} lg={10}>
<ProCard title="Revenue by channel" subTitle={`total ${vnd(rev)}`} headerBordered style={{ height: "100%" }}>
<Pie height={220} data={CHANNELS.map((c, i) => ({ type: c.label, value: d.cur.rev[i] }))} angleField="value" colorField="type"
innerRadius={0.66} label={false} legend={false} scale={{ color: { range: chColors } }}
tooltip={{ items: [{ field: "value", valueFormatter: (v: number) => vnd(v) }] }}
annotations={[{ type: "text", style: { text: short(rev), x: "50%", y: "50%", textAlign: "center", fontSize: 18, fontWeight: 600 } }]} />
<Flex vertical gap={8}>
{CHANNELS.map((c, i) => (
<Flex key={c.label} justify="space-between" gap={8}>
<Badge color={chColors[i]} text={c.label} />
<Typography.Text type="secondary">{nf.format(d.cur.orders[i])} orders</Typography.Text>
<span><b>{short(d.cur.rev[i])}</b> <Typography.Text type="secondary">· {pct(d.cur.rev[i] / rev)}</Typography.Text></span>
</Flex>
))}
</Flex>
</ProCard>
</Col>
<Col xs={24} lg={14}>
<ProCard title="Best sellers" subTitle="by revenue" extra={<a>View product report</a>} headerBordered style={{ height: "100%" }}>
<Flex vertical gap={12}>
{top.map((p, i) => (
<Flex key={p.name} align="center" gap={12}>
<Typography.Text strong style={{ width: 20, color: i < 3 ? token.colorPrimary : token.colorTextTertiary }}>{i + 1}</Typography.Text>
<Flex vertical style={{ flex: 1, minWidth: 0 }}>
<Flex justify="space-between" gap={8}>
<Typography.Text ellipsis>{p.name}</Typography.Text>
<Typography.Text strong>{short(p.value)}</Typography.Text>
</Flex>
<Flex align="center" gap={8}>
<Progress percent={(p.value / top[0].value) * 100} showInfo={false} size="small" style={{ flex: 1, margin: 0 }} />
<Typography.Text type="secondary" style={{ fontSize: 12, width: 64, textAlign: "right" }}>{nf.format(p.units)} units</Typography.Text>
</Flex>
</Flex>
</Flex>
))}
</Flex>
</ProCard>
</Col>
</Row>
<ProCard title="Low stock" subTitle={`${STOCK.length} SKUs below minimum stock`} extra={<a>Open inventory</a>} headerBordered bodyStyle={{ paddingTop: 0 }}>
<Table<Stock> rowKey="sku" size="small" columns={stockCols} dataSource={STOCK} pagination={false} scroll={{ x: 760 }} />
</ProCard>
</Flex>
</PageContainer>
);
}
Build a daily executive dashboard for the owner of a furniture chain that sells on 3 channels (showroom, website, B2B projects). At the top: a greeting with the data timestamp and a period picker Today / 7 days / This month / 12 months; changing the period changes every number and compares it with the matching previous period (yesterday at the same hour, the same days last month…). First row: 4 KPI cards with sparklines — revenue, new orders, gross margin (change shown in percentage points), and orders in progress with a bar stacked by status. Next: a column chart of revenue and gross profit by hour/day/month, and beside it a "To do" panel where every row is clickable and shows a count — orders waiting for confirmation over 2 hours, late deliveries, items below minimum stock and overdue B2B receivables. Add a donut of revenue by channel (the channels must add up to total revenue), a "Best sellers" list with progress bars, and a low-stock table with a button to create a purchase order. Format money for the app's locale. Every number comes from the app's API through useApiClient() (period report, to-do counts, low-stock list) — no hard-coded data.
Next steps
- App shell and page header —
PageContainerfor the greeting and the main button. - List pages — the View all button opens this page.
- Page recipes — approver and analytics dashboard layouts.