Skip to Content

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.

DashboardApprover dashboard: StatisticCard.Group (each number with a sub-line) + a to-do list (ProList) + a donut chart.
example.manh.run · sample dataOpen in editor ↗
The example runs when you scroll to it

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" → Pie

A 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.

app/page.tsx
<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.

app/page.tsx
<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.
  • onClick takes the reader to the list behind the number. Items that are false or null are 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.

app/page.tsx
<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 → Pie with innerRadius.
  • 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 gutter for columns: the cards end up about 8px inside the KPI row.
  • Set height and autoFit on 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.

Executive dashboard (multi-channel retail)Daily dashboard for a furniture retailer selling on 3 channels: a period picker (today / 7 days / month / 12 months) changes every number, 4 KPIs compared with the previous period, revenue – profit chart, channel mix, best sellers, to-dos and low-stock alerts.
example.manh.run · sample dataOpen in editor ↗
The example runs when you scroll to it

Next steps

Last updated