UI templates
Each template is one app/page.tsx written with the Manh framework, running in the page with mock data. The Code tab shows the file to copy; Open in editor lets you try changes in the Playground. When you brief an agent, naming the template is enough for it to build the screen on that frame.
Whole apps (UI, API, database, sample data) are on the Showcase page.
ProLayout app shell
Multi-level menu, app switcher and user avatar. Every app starts from this shell.
// App shell: ProLayout mix + 3-level grouped menu + 9-dot app launcher + header icons + avatar.
// In a real app: menuItemRender uses useNavigate()/<Link>, location = useLocation().
import { useState } from "react";
import { PageContainer, ProCard, ProLayout } from "@ant-design/pro-components";
import { Dropdown, Typography, theme } from "antd";
import {
AppstoreOutlined, AuditOutlined, BarChartOutlined, FileTextOutlined, GithubFilled,
InfoCircleFilled, LogoutOutlined, QuestionCircleFilled, ShoppingOutlined, TeamOutlined,
} from "@ant-design/icons";
const route = {
path: "/",
children: [
{
path: "/ops", name: "Operations", icon: <AppstoreOutlined />,
children: [
{ path: "/ops/orders", name: "Orders", icon: <ShoppingOutlined />, children: [
{ path: "/ops/orders/all", name: "All orders" },
{ path: "/ops/orders/pending", name: "To process" },
] },
{ path: "/ops/requests", name: "Purchase requests", icon: <FileTextOutlined />, children: [
{ path: "/ops/requests/mine", name: "Mine" },
{ path: "/ops/requests/inbox", name: "Needs my approval" },
] },
],
},
{
path: "/report", name: "Reports", icon: <BarChartOutlined />,
children: [
{ path: "/report/sales", name: "Sales", icon: <BarChartOutlined />, children: [
{ path: "/report/sales/month", name: "By month" },
] },
],
},
],
};
const appList = [
{ title: "Internal", desc: "Company apps", children: [
{ title: "CRM", desc: "Customers & deals", icon: <TeamOutlined />, url: "#crm" },
{ title: "Inventory", desc: "Stock & shipments", icon: <ShoppingOutlined />, url: "#inventory" },
] },
{ title: "Tools", desc: "Shared", children: [
{ title: "Purchase approvals", desc: "Requests & approvals", icon: <AuditOutlined />, url: "#approvals" },
] },
];
export default function Page() {
const { token } = theme.useToken();
const [pathname, setPathname] = useState("/ops/orders/all");
return (
<div style={{ height: "100vh" }}>
<ProLayout
title="Acme Admin"
logo={<AuditOutlined style={{ fontSize: 22, color: token.colorPrimary }} />}
layout="mix"
splitMenus
siderMenuType="group"
menu={{ collapsedShowGroupTitle: true, locale: false }}
fixSiderbar
route={route}
location={{ pathname }}
menuItemRender={(item, dom) => <a onClick={() => item.path && setPathname(item.path)}>{dom}</a>}
appList={appList}
bgLayoutImgList={[
{ src: "https://img.alicdn.com/imgextra/i2/O1CN01O4etvp1DvpFLKfuWq_!!6000000000279-2-tps-609-606.png", left: 85, bottom: 100, height: "303px" },
{ src: "https://img.alicdn.com/imgextra/i3/O1CN018NxReL1shX85Yz6Cx_!!6000000005798-2-tps-884-496.png", bottom: 0, left: 0, width: "331px" },
]}
actionsRender={(p) => (p.isMobile ? [] : [<InfoCircleFilled key="i" />, <QuestionCircleFilled key="q" />, <GithubFilled key="g" />])}
avatarProps={{
size: "small",
title: "Hannah Reed",
src: "https://manh.run/avatars/06.svg",
render: (_, dom) => <Dropdown menu={{ items: [{ key: "out", icon: <LogoutOutlined />, label: "Sign out" }] }}>{dom}</Dropdown>,
}}
menuFooterRender={(p) => (p?.collapsed ? undefined : <div style={{ textAlign: "center", paddingBlockStart: 12, color: token.colorTextTertiary }}>v1.0 · Acme</div>)}
>
<PageContainer subTitle={pathname}>
<ProCard>
<Typography.Paragraph>
Click the menu items (top: level-1 groups; left: level-2 group titles + level-3 items) and the 9-dot button next to the logo.
</Typography.Paragraph>
</ProCard>
</PageContainer>
</ProLayout>
</div>
);
}
Build the "ProLayout app shell" screen for my app following the Manh UI playbook (framework_docs("pro")): App shell: ProLayout mix + 3-level grouped menu + 9-dot app launcher + header icons + avatar. Data comes from the app's API through useApiClient(); labels and fields follow my spec.Sign in
Email and password sign-in that returns a JWT. Included when you create a project with the auth starter.
// Sign-in: pro-components LoginForm with labels (accessibility + tests find fields by label); server errors show in `message`.
import { useState } from "react";
import { LoginForm, ProFormCheckbox, ProFormText } from "@ant-design/pro-components";
import { Alert, Flex, Typography, theme } from "antd";
import { AuditOutlined, LockOutlined, MailOutlined } from "@ant-design/icons";
export default function Page() {
const { token } = theme.useToken();
const [error, setError] = useState<string | null>(null);
return (
<Flex vertical justify="center" style={{ minHeight: "100vh", background: `linear-gradient(180deg, ${token.colorPrimaryBg} 0%, ${token.colorBgLayout} 45%)` }}>
<LoginForm
logo={<AuditOutlined style={{ fontSize: 40, color: token.colorPrimary }} />}
title="Purchase approvals"
subTitle="Request, approve and track purchase spending"
submitter={{ searchConfig: { submitText: "Sign in" } }}
initialValues={{ remember: true }}
message={error ? <Alert type="error" showIcon title={error} style={{ marginBottom: 24 }} /> : undefined}
actions={
<Flex vertical gap={8}>
<Typography.Text type="secondary">Don't have an account? <a>Sign up</a></Typography.Text>
{/* UI sample (Playground / docs): say clearly it's a demo so nobody types a real password. */}
<Typography.Text type="secondary" style={{ fontSize: 12 }}>UI demo — don't enter a real password; nothing is sent anywhere. Test password: 123456.</Typography.Text>
</Flex>
}
onFinish={async (v: { email: string; password: string }) => {
// Try it: any password other than "123456" shows the error a 401 from the server would.
if (v.password !== "123456") { setError("Incorrect email or password"); return false; }
setError(null);
return true;
}}
>
<ProFormText name="email" label="Email" placeholder="you@company.com" fieldProps={{ size: "large", prefix: <MailOutlined /> }} rules={[{ required: true, type: "email", message: "Enter a valid email" }]} />
<ProFormText.Password name="password" label="Password" placeholder="Password" fieldProps={{ size: "large", prefix: <LockOutlined />, autoComplete: "off" }} rules={[{ required: true, message: "Enter your password" }]} />
<div style={{ marginBlockEnd: 24 }}>
<ProFormCheckbox noStyle name="remember">Keep me signed in</ProFormCheckbox>
<a style={{ float: "right" }}>Forgot password?</a>
</div>
</LoginForm>
</Flex>
);
}
Build the "Sign in" screen for my app following the Manh UI playbook (framework_docs("pro")): Sign in: the pro-components LoginForm with labels (accessible + testable by label), server errors shown in `message`. Data comes from the app's API through useApiClient(); labels and fields follow my spec.ProTable list
Search form, status tabs with counts, bulk selection and server-side paging.
// List: ProTable with a search form, status tabs with counts, multi-select to approve, valueEnum rendered as Badge.
// In a real app: request calls api.<resource>.list(...) and returns { data, total, success: true }.
import { useMemo, useRef, useState } from "react";
import { PageContainer, ProTable, type ActionType, type ProColumns } from "@ant-design/pro-components";
import { App, Badge, Button, Popconfirm, Space, Typography } from "antd";
import { CheckOutlined, PlusOutlined } from "@ant-design/icons";
type Status = "pending" | "approved" | "rejected";
type Row = { id: number; title: string; amount: number; owner: string; dept: string; status: Status; category: string; createdAt: string };
const STATUS = {
pending: { text: "Pending", status: "Processing" },
approved: { text: "Approved", status: "Success" },
rejected: { text: "Rejected", status: "Error" },
} as const;
const CATEGORY = { office: { text: "Office supplies" }, equipment: { text: "Equipment" }, software: { text: "Software" } };
const vnd = (n: number) => n.toLocaleString("en-US", { style: "currency", currency: "USD" });
const SEED: Row[] = [
{ id: 9, title: "Renew Microsoft 365 (12 months, 10 users)", amount: 1500, owner: "Laura Bennett", dept: "Operations", status: "pending", category: "software", createdAt: "2026-11-10" },
{ id: 8, title: "2× Dell P2423 monitors for the dev team", amount: 520, owner: "Michael Carter", dept: "Engineering", status: "pending", category: "equipment", createdAt: "2026-11-09" },
{ id: 7, title: "Letter paper (20 reams)", amount: 145, owner: "Laura Bennett", dept: "Operations", status: "approved", category: "office", createdAt: "2026-11-05" },
{ id: 6, title: "Mechanical keyboard for dev", amount: 129, owner: "Michael Carter", dept: "Engineering", status: "rejected", category: "equipment", createdAt: "2026-11-02" },
];
export default function Page() {
const { message } = App.useApp();
const ref = useRef<ActionType>(undefined);
const [rows, setRows] = useState(SEED);
const [tab, setTab] = useState<"all" | Status>("pending");
const counts = useMemo(() => ({
all: rows.length,
pending: rows.filter((r) => r.status === "pending").length,
approved: rows.filter((r) => r.status === "approved").length,
rejected: rows.filter((r) => r.status === "rejected").length,
}), [rows]);
const columns: ProColumns<Row>[] = [
{ title: "Title", dataIndex: "title", ellipsis: true, fieldProps: { placeholder: "Search by title" },
render: (_, r) => (
<Space orientation="vertical" size={0}>
<Typography.Link strong>{r.title}</Typography.Link>
<Typography.Text type="secondary" style={{ fontSize: 12 }}>#{r.id} · {r.createdAt}</Typography.Text>
</Space>
) },
{ title: "Amount", dataIndex: "amount", align: "right", search: false, render: (_, r) => <b>{vnd(r.amount)}</b> },
{ title: "Requested by", dataIndex: "owner", search: false,
render: (_, r) => <Space orientation="vertical" size={0}><span>{r.owner}</span><Typography.Text type="secondary" style={{ fontSize: 12 }}>{r.dept}</Typography.Text></Space> },
{ title: "Status", dataIndex: "status", valueEnum: STATUS, search: false },
{ title: "Category", dataIndex: "category", valueType: "select", valueEnum: CATEGORY },
{ title: "Actions", valueType: "option", render: () => [<a key="v">View</a>] },
];
return (
<PageContainer title="All requests" subTitle="Approve or reject your team's requests">
<ProTable<Row>
actionRef={ref}
rowKey="id"
cardBordered
columns={columns}
params={{ tab, rows }}
search={{ labelWidth: "auto", searchText: "Search", resetText: "Clear filters" }}
pagination={{ pageSize: 10, showTotal: (t) => `${t} requests` }}
request={async (p: Record<string, unknown>) => {
const data = rows
.filter((r) => tab === "all" || r.status === tab)
.filter((r) => !p.title || r.title.toLowerCase().includes(String(p.title).toLowerCase()))
.filter((r) => !p.category || r.category === p.category);
return { data, total: data.length, success: true };
}}
toolbar={{
menu: {
type: "tab",
activeKey: tab,
onChange: (k) => setTab(k as typeof tab),
items: (["all", "pending", "approved", "rejected"] as const).map((k) => ({
key: k,
label: <span>{k === "all" ? "All" : STATUS[k].text}<Badge count={counts[k]} color={k === "pending" ? "orange" : "#bfbfbf"} style={{ marginInlineStart: 6 }} /></span>,
})),
},
}}
rowSelection={tab === "pending" ? {} : undefined}
tableAlertRender={({ selectedRows }) => <span><b>{selectedRows.length}</b> selected · total <b>{vnd(selectedRows.reduce((a, r) => a + r.amount, 0))}</b></span>}
tableAlertOptionRender={({ selectedRows, onCleanSelected }) => (
<Space>
<a onClick={onCleanSelected}>Clear selection</a>
<Popconfirm title={`Approve ${selectedRows.length} requests?`} onConfirm={() => {
const ids = new Set(selectedRows.map((r) => r.id));
setRows((all) => all.map((r) => (ids.has(r.id) ? { ...r, status: "approved" } : r)));
message.success(`Approved ${ids.size} requests`);
onCleanSelected();
}}>
<Button type="primary" size="small" icon={<CheckOutlined />}>Approve selected</Button>
</Popconfirm>
</Space>
)}
toolBarRender={() => [<Button key="n" type="primary" icon={<PlusOutlined />}>New request</Button>]}
/>
</PageContainer>
);
}
Build the "ProTable list" screen for my app following the Manh UI playbook (framework_docs("pro")): List: ProTable with a search form, status tabs with counts, multi-select to approve, valueEnum as Badges. Data comes from the app's API through useApiClient(); labels and fields follow my spec.Card list
A card grid with tags, progress and hover actions.
// Card list: Card grid (title, tag, avatar, description, progress, actions on hover).
import { PageContainer } from "@ant-design/pro-components";
import { Avatar, Card, Progress, Segmented, Tag } from "antd";
import { useState } from "react";
/** 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 projects = [
{ id: 1, name: "CRM rollout", owner: "Michael Carter", tag: "In progress", pct: 72, desc: "Move customers from spreadsheets into the CRM and train 12 sales reps." },
{ id: 2, name: "Q4 stock count", owner: "Laura Bennett", tag: "Due soon", pct: 40, desc: "Reconcile inventory across 3 warehouses by Nov 30." },
{ id: 3, name: "Careers site", owner: "Daniel Brooks", tag: "Done", pct: 100, desc: "New careers page with an application form." },
{ id: 4, name: "Contract digitization", owner: "Hannah Reed", tag: "In progress", pct: 18, desc: "Scan and tag 1,200 legacy contracts." },
];
const TAG_COLOR: Record<string, string> = { "In progress": "processing", "Due soon": "warning", "Done": "success" };
export default function Page() {
const [filter, setFilter] = useState("All");
const data = projects.filter((p) => filter === "All" || p.tag === filter);
return (
<PageContainer title="Projects" extra={<Segmented options={["All", "In progress", "Due soon", "Done"]} value={filter} onChange={(v) => setFilter(String(v))} />}>
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
{data.map((r) => (
<Card key={r.id} hoverable className="group">
<Card.Meta
avatar={<Avatar src={face(r.owner)} alt={r.owner} />}
title={
<div className="flex flex-wrap items-center gap-2">
<span>{r.name}</span>
<Tag color={TAG_COLOR[r.tag]}>{r.tag}</Tag>
</div>
}
description={r.desc}
/>
<Progress className="!mt-3" percent={r.pct} size="small" status={r.pct === 100 ? "success" : "active"} />
<div className="mt-2 flex justify-end gap-4 opacity-0 transition-opacity group-hover:opacity-100">
<a>Open</a>
<a>Edit</a>
</div>
</Card>
))}
</div>
</PageContainer>
);
}
Build the "Card list" screen for my app following the Manh UI playbook (framework_docs("pro")): Card list: ProList grid + metas (title, subTitle tag, avatar, description, progress content, actions on hover). Data comes from the app's API through useApiClient(); labels and fields follow my spec.Drag-and-drop kanban
Columns by status; cards move between them with dnd-kit.
// Sales pipeline kanban: @dnd-kit drags cards between columns, with a count and total value per column; cards styled with antd tokens.
import { useMemo, useState } from "react";
import { PageContainer } from "@ant-design/pro-components";
import { Avatar, Badge, Card, Flex, Tag, Typography, theme } from "antd";
import { DndContext, DragOverlay, PointerSensor, useDroppable, useDraggable, useSensor, useSensors, type DragEndEvent, type DragStartEvent } from "@dnd-kit/core";
/** 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`;
};
type Stage = "lead" | "contact" | "quote" | "won";
type Deal = { id: string; name: string; company: string; value: number; owner: string; stage: Stage };
const STAGES: Array<{ key: Stage; title: string; color: string }> = [
{ key: "lead", title: "Lead", color: "default" },
{ key: "contact", title: "Contacted", color: "processing" },
{ key: "quote", title: "Quoted", color: "warning" },
{ key: "won", title: "Won", color: "success" },
];
const DEALS: Deal[] = [
{ id: "d1", name: "Inventory software", company: "Acme Supply Co.", value: 48_000, owner: "Mike", stage: "lead" },
{ id: "d2", name: "CRM plan, 20 seats", company: "Eastgate Group", value: 34_000, owner: "Laura", stage: "contact" },
{ id: "d3", name: "2027 maintenance", company: "Northwind Steel", value: 16_000, owner: "Ben", stage: "quote" },
{ id: "d4", name: "Invoicing integration", company: "Maple Street Cafe", value: 10_000, owner: "Mike", stage: "won" },
{ id: "d5", name: "Sales dashboard", company: "GreenLeaf Market", value: 24_000, owner: "Hannah", stage: "lead" },
];
const vnd = (n: number) => n.toLocaleString("en-US", { style: "currency", currency: "USD", maximumFractionDigits: 0 });
function DealCard({ deal, dragging }: { deal: Deal; dragging?: boolean }) {
return (
<Card size="small" style={{ cursor: "grab", opacity: dragging ? 0.4 : 1 }}>
<Typography.Text strong>{deal.name}</Typography.Text>
<div style={{ fontSize: 12 }}>
<Typography.Text type="secondary">{deal.company}</Typography.Text>
</div>
<Flex justify="space-between" align="center" style={{ marginTop: 8 }}>
<Typography.Text>{vnd(deal.value)}</Typography.Text>
<Avatar size="small" src={face(deal.owner)} alt={deal.owner} />
</Flex>
</Card>
);
}
function Draggable({ deal }: { deal: Deal }) {
const { attributes, listeners, setNodeRef, isDragging } = useDraggable({ id: deal.id });
return (
<div ref={setNodeRef} {...listeners} {...attributes}>
<DealCard deal={deal} dragging={isDragging} />
</div>
);
}
function Column({ stage, deals }: { stage: (typeof STAGES)[number]; deals: Deal[] }) {
const { token } = theme.useToken();
const { setNodeRef, isOver } = useDroppable({ id: stage.key });
const total = deals.reduce((a, d) => a + d.value, 0);
return (
<div
ref={setNodeRef}
style={{ flex: "1 1 240px", minWidth: 220, background: isOver ? token.colorPrimaryBg : token.colorFillQuaternary, borderRadius: token.borderRadiusLG, padding: token.paddingSM }}
>
<Flex justify="space-between" align="center" style={{ marginBottom: 8 }}>
<Flex gap={6} align="center">
<Tag color={stage.color}>{stage.title}</Tag>
<Badge count={deals.length} showZero color={token.colorTextTertiary} />
</Flex>
<Typography.Text type="secondary" style={{ fontSize: 12 }}>{vnd(total)}</Typography.Text>
</Flex>
<Flex vertical gap={8} style={{ minHeight: 120 }}>
{deals.map((d) => (
<Draggable key={d.id} deal={d} />
))}
</Flex>
</div>
);
}
export default function Page() {
const [deals, setDeals] = useState(DEALS);
const [active, setActive] = useState<string | null>(null);
const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 5 } }));
const byStage = useMemo(() => Object.fromEntries(STAGES.map((s) => [s.key, deals.filter((d) => d.stage === s.key)])), [deals]);
const onStart = (e: DragStartEvent) => setActive(String(e.active.id));
const onEnd = (e: DragEndEvent) => {
setActive(null);
const to = e.over?.id as Stage | undefined;
if (!to) return;
// Real app: await api.deals.update(id, { stage: to }) then refresh().
setDeals((ds) => ds.map((d) => (d.id === e.active.id ? { ...d, stage: to } : d)));
};
return (
<PageContainer title="Sales pipeline" subTitle="Drag a card to another column to change its stage">
<DndContext sensors={sensors} onDragStart={onStart} onDragEnd={onEnd}>
<Flex gap={12} wrap align="flex-start">
{STAGES.map((s) => (
<Column key={s.key} stage={s} deals={byStage[s.key]} />
))}
</Flex>
<DragOverlay>{active ? <DealCard deal={deals.find((d) => d.id === active)!} /> : null}</DragOverlay>
</DndContext>
</PageContainer>
);
}
Build the "Drag-and-drop kanban (dnd-kit)" screen for my app following the Manh UI playbook (framework_docs("pro")): Customer pipeline kanban: @dnd-kit drags cards between columns, count and total value per column, ProCard cards on antd tokens. Data comes from the app's API through useApiClient(); labels and fields follow my spec.Dashboard
Monthly KPIs, a to-do list sorted by deadline and a donut chart by category.
// 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.Drawer form
Create and edit records in a drawer, with validation and a guided empty state.
// Create/edit form in a DrawerForm: ProFormMoney ($), field groups, tooltip, past dates blocked, return true to close.
import { useState } from "react";
import { DrawerForm, PageContainer, ProCard, ProFormDatePicker, ProFormGroup, ProFormMoney, ProFormSelect, ProFormText, ProFormTextArea } from "@ant-design/pro-components";
import { App, Button, Empty, Listy } from "antd";
import { PlusOutlined } from "@ant-design/icons";
import dayjs from "dayjs";
type Req = { title: string; amount: number; category: string; neededBy?: string };
export default function Page() {
const { message } = App.useApp();
const [items, setItems] = useState<Req[]>([]);
return (
<PageContainer title="My requests">
<ProCard
title="Submitted"
headerBordered
extra={
<DrawerForm<Record<string, unknown>>
title="New purchase request"
width={560}
trigger={<Button type="primary" icon={<PlusOutlined />}>New request</Button>}
drawerProps={{ destroyOnHidden: true }}
submitter={{ searchConfig: { submitText: "Submit request", resetText: "Cancel" } }}
initialValues={{ category: "office" }}
onFinish={async (v) => {
setItems((x) => [{ title: String(v.title), amount: Number(v.amount), category: String(v.category), neededBy: v.neededBy ? String(v.neededBy) : undefined }, ...x]);
message.success("Request submitted — waiting for manager approval");
return true; // close the drawer
}}
>
<ProFormText name="title" label="Title" placeholder="e.g. Renew Microsoft 365" tooltip="Make it clear enough that your manager doesn't need to open the details" rules={[{ required: true, min: 3, message: "At least 3 characters" }]} />
<ProFormGroup>
<ProFormMoney name="amount" label="Amount" width="sm" customSymbol="$" locale="en-US" min={1} fieldProps={{ precision: 2 }} rules={[{ required: true, message: "Enter an amount" }]} />
<ProFormSelect name="category" label="Category" width="sm" valueEnum={{ office: "Office supplies", equipment: "Equipment", software: "Software", service: "Services" }} rules={[{ required: true }]} />
</ProFormGroup>
<ProFormDatePicker name="neededBy" label="Needed by" width="sm" fieldProps={{ format: "MM/DD/YYYY", disabledDate: (d: dayjs.Dayjs) => d.isBefore(dayjs().startOf("day")) }}
// submitted in the DISPLAY format ("11/20/2026") — convert to ISO for the API
transform={(v: string | undefined) => ({ neededBy: v ? ((p: string[]) => `${p[2]}-${p[0]}-${p[1]}`)(v.split("/")) : undefined })} />
<ProFormTextArea name="description" label="Description" placeholder="Reason, vendor, link to the quote…" fieldProps={{ rows: 4, maxLength: 2000, showCount: true }} />
</DrawerForm>
}
>
{items.length ? (
(items?.length ? (
<Listy items={items} itemRender={(r) => <div className="flex items-start gap-4">
<div className="min-w-0 flex-1">{r.title}{r.neededBy ? ` · needed by ${r.neededBy}` : ""}</div>
<div className="shrink-0"><b>{r.amount.toLocaleString("en-US", { style: "currency", currency: "USD" })}</b></div>
</div>}
rowKey={(_, i) => i}
rowHoverable={false}
/>
) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
))
) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description="No requests yet — click “New request”." />
)}
</ProCard>
</PageContainer>
);
}
Build the "Form in a Drawer" screen for my app following the Manh UI playbook (framework_docs("pro")): Create/edit form in a DrawerForm: ProFormMoney, field groups, tooltips, no past dates, return true to close. Data comes from the app's API through useApiClient(); labels and fields follow my spec.Step form
A three-step stock transfer: fill in, confirm, done.
// Multi-step form: StepsForm (fill in → confirm → result). The last step hides the buttons and shows a Result.
import { useState } from "react";
import { PageContainer, ProCard, ProFormDigit, ProFormSelect, ProFormText, StepsForm } from "@ant-design/pro-components";
import { Alert, Button, Descriptions, Result } from "antd";
export default function Page() {
const [current, setCurrent] = useState(0);
const [data, setData] = useState<Record<string, unknown>>({});
return (
<PageContainer title="Stock transfer" subTitle="Move stock between warehouses in 3 steps">
<ProCard>
<StepsForm
current={current}
onCurrentChange={setCurrent}
submitter={{
render: (props, dom) => (props.step === 2 ? null : dom),
submitButtonProps: { style: { minWidth: 120 } },
}}
onFinish={async () => true}
>
<StepsForm.StepForm name="fill" title="Details" onFinish={async (v) => { setData(v); return true; }}>
<ProFormSelect name="from" label="From warehouse" width="md" rules={[{ required: true }]} valueEnum={{ hn: "Chicago warehouse", hcm: "Dallas warehouse" }} />
<ProFormSelect name="to" label="To warehouse" width="md" rules={[{ required: true }]} valueEnum={{ hn: "Chicago warehouse", hcm: "Dallas warehouse", dn: "Denver warehouse" }} />
<ProFormText name="sku" label="SKU" width="md" placeholder="SKU-0001" rules={[{ required: true }]} />
<ProFormDigit name="qty" label="Quantity" width="sm" min={1} fieldProps={{ precision: 0 }} rules={[{ required: true }]} />
</StepsForm.StepForm>
<StepsForm.StepForm name="confirm" title="Confirm">
<Alert type="info" showIcon title="Double-check before creating the transfer — it can't be edited afterwards." style={{ marginBottom: 24 }} />
<Descriptions column={1} bordered size="small" items={[{ label: "From warehouse", children: String(data.from ?? "") }, { label: "To warehouse", children: String(data.to ?? "") }, { label: "SKU", children: String(data.sku ?? "") }, { label: "Quantity", children: String(data.qty ?? "") }]} />
</StepsForm.StepForm>
<StepsForm.StepForm name="done" title="Done">
<Result status="success" title="Transfer created" subTitle="The receiving warehouse will see it under “Incoming”."
extra={[<Button key="again" type="primary" onClick={() => setCurrent(0)}>Create another</Button>, <Button key="view">View transfer</Button>]} />
</StepsForm.StepForm>
</StepsForm>
</ProCard>
</PageContainer>
);
}
Build the "Multi-step form" screen for my app following the Manh UI playbook (framework_docs("pro")): Multi-step form: StepsForm (fill in → confirm → result). The last step hides the buttons and shows a Result. Data comes from the app's API through useApiClient(); labels and fields follow my spec.Detail and approval
Record details, change history, and approve or reject with a reason.
// Detail page: PageContainer (breadcrumb, tag, summary, key figure) + progress Steps + Info + Timeline + decision buttons pinned to the footer.
// No PageContainer onBack (it crashes the page on this runtime) — use the breadcrumb.
import { useState } from "react";
import { ModalForm, PageContainer, ProCard, ProDescriptions, ProFormTextArea } from "@ant-design/pro-components";
import { Alert, App, Button, Col, Flex, Row, Space, Steps, Tag, Timeline, Typography } from "antd";
import { CheckOutlined, CloseOutlined } from "@ant-design/icons";
export default function Page() {
const { message } = App.useApp();
const [status, setStatus] = useState<"pending" | "approved" | "rejected">("pending");
const [note, setNote] = useState<string | null>(null);
const events = [
{ color: "blue", text: <><b>Laura Bennett</b> created the request</>, at: "Nov 10, 2026 · 12:52 PM" },
...(status !== "pending" ? [{ color: status === "approved" ? "green" : "red", text: <><b>Hannah Reed</b> {status === "approved" ? "approved" : "rejected"}{note ? <> — <i>“{note}”</i></> : null}</>, at: "just now" }] : []),
];
const decide = (to: "approved" | "rejected") => async (v: { note?: string }) => {
setStatus(to); setNote(v.note ?? null);
message.success(to === "approved" ? "Approved" : "Rejected");
return true;
};
return (
<PageContainer
header={{
title: "Renew Microsoft 365 Business (12 months, 10 users)",
breadcrumb: { items: [{ title: <a>Requests</a> }, { title: "#9" }] },
tags: <Tag color={status === "pending" ? "processing" : status === "approved" ? "success" : "error"}>{status === "pending" ? "Pending" : status === "approved" ? "Approved" : "Rejected"}</Tag>,
}}
content={
<ProDescriptions column={{ xs: 1, sm: 2, lg: 3 }}>
<ProDescriptions.Item label="Requested by">Laura Bennett · Operations</ProDescriptions.Item>
<ProDescriptions.Item label="Category">Software</ProDescriptions.Item>
<ProDescriptions.Item label="Needed by">Nov 13, 2026</ProDescriptions.Item>
</ProDescriptions>
}
extraContent={
<Space orientation="vertical" size={0} style={{ textAlign: "right" }}>
<Typography.Text type="secondary">Requested amount</Typography.Text>
<Typography.Text strong style={{ fontSize: 28 }}>$1,500.00</Typography.Text>
</Space>
}
footer={status === "pending" ? [
<ModalForm key="r" title="Reject request" width={480} trigger={<Button danger icon={<CloseOutlined />}>Reject</Button>} onFinish={decide("rejected")} modalProps={{ okText: "Reject", okButtonProps: { danger: true } }}>
<ProFormTextArea name="note" label="Reason for rejection" rules={[{ required: true, whitespace: true, message: "Please add a reason" }]} />
</ModalForm>,
<ModalForm key="a" title="Approve request" width={480} trigger={<Button type="primary" icon={<CheckOutlined />}>Approve</Button>} onFinish={decide("approved")} modalProps={{ okText: "Approve" }}>
<ProFormTextArea name="note" label="Note (optional)" />
</ModalForm>,
] : undefined}
>
<Flex vertical gap={16}>
<ProCard title="Progress" headerBordered>
<Steps current={status === "pending" ? 1 : 2} status={status === "rejected" ? "error" : status === "approved" ? "finish" : "process"}
items={[{ title: "Submitted", content: "Laura Bennett · Nov 10, 12:52 PM" }, { title: status === "pending" ? "Manager approval" : status === "approved" ? "Approved" : "Rejected", content: status === "pending" ? "Needed by Nov 13" : "Hannah Reed" }]} />
</ProCard>
{status === "rejected" && <Alert type="error" showIcon title="Rejected by Hannah Reed" description={`Reason: ${note}`} />}
<Row gutter={[16, 16]}>
<Col xs={24} lg={15}>
<ProCard title="Details" headerBordered style={{ height: "100%" }}>
<Typography.Paragraph>The current plan expires at the end of the month. We need to renew it so email isn't interrupted.</Typography.Paragraph>
</ProCard>
</Col>
<Col xs={24} lg={9}>
<ProCard title="History" headerBordered style={{ height: "100%" }}>
<Timeline items={events.map((e) => ({ color: e.color, children: <><div>{e.text}</div><Typography.Text type="secondary" style={{ fontSize: 12 }}>{e.at}</Typography.Text></> }))} />
</ProCard>
</Col>
</Row>
</Flex>
</PageContainer>
);
}
Build the "Detail page + approval" screen for my app following the Manh UI playbook (framework_docs("pro")): Detail page: PageContainer (breadcrumb, tag, summary, key numbers) + progress Steps + info + Timeline + decision buttons fixed at the bottom. Data comes from the app's API through useApiClient(); labels and fields follow my spec.Org chart
Departments and owners drawn with @ant-design/graphs.
// Read-only org chart: @ant-design/graphs OrganizationChart built from department data (G6: { nodes: [{ id, data }], edges }).
import { useMemo, useState } from "react";
import { PageContainer, ProCard } from "@ant-design/pro-components";
import { Segmented } from "antd";
import { OrganizationChart } from "@ant-design/graphs";
const people = [
{ id: "ceo", name: "Sarah Mitchell · CEO", manager: null },
{ id: "cfo", name: "James Porter · CFO", manager: "ceo" },
{ id: "coo", name: "Emily Chen · Operations", manager: "ceo" },
{ id: "sales", name: "David Ross · Sales", manager: "ceo" },
{ id: "acc1", name: "Olivia · Accounting", manager: "cfo" },
{ id: "wh", name: "Ryan · Warehouse", manager: "coo" },
{ id: "ship", name: "Grace · Delivery", manager: "coo" },
{ id: "s1", name: "Kevin · Sales", manager: "sales" },
{ id: "s2", name: "Megan · Sales", manager: "sales" },
];
export default function Page() {
const [direction, setDirection] = useState<"vertical" | "horizontal">("vertical");
const data = useMemo(
() => ({
nodes: people.map((p) => ({ id: p.id, data: { name: p.name } })),
edges: people.filter((p) => p.manager).map((p) => ({ source: p.manager as string, target: p.id })),
}),
[],
);
return (
<PageContainer title="Org chart">
<ProCard
extra={
<Segmented
value={direction}
onChange={(v) => setDirection(v as "vertical" | "horizontal")}
options={[
{ value: "vertical", label: "Vertical" },
{ value: "horizontal", label: "Horizontal" },
]}
/>
}
>
<div style={{ height: 520 }}>
<OrganizationChart key={direction} data={data} direction={direction} labelField={(d: { data?: { name?: string } }) => d.data?.name ?? ""} autoFit="view" />
</div>
</ProCard>
</PageContainer>
);
}
Build the "Org chart (graphs)" screen for my app following the Manh UI playbook (framework_docs("pro")): Read-only org chart: @ant-design/graphs OrganizationChart from department data (G6: { nodes: [{ id, data }], edges }). Data comes from the app's API through useApiClient(); labels and fields follow my spec.Next steps
- Live examples — whole business screens: executive dashboard, point of sale, receivables.
- Pick a component for the job — which table, kanban, calendar or form fits each job.