List pages
A list page shows many records, lets users search, filter by status, and select several rows to act on at once, built with ProTable.
This is where users work every day: an approver opens the request inbox, filters the pending ones, selects a few and approves them in one step. ProTable ships search, pagination, row selection and a toolbar. You declare the columns and how to load the data.
// 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.Declare the columns once
Each column is both a table column and decides whether it becomes a search field. Declare one columns array and reuse it for the table, the search form, and the detail page.
const columns: ProColumns<Req>[] = [
{ title: "Title", dataIndex: "title", ellipsis: true }, // becomes a search field
{ title: "Amount", dataIndex: "amount", align: "right", search: false,
render: (_, r) => <b>{vnd(r.amount)}</b> },
{ title: "Status", dataIndex: "status", valueEnum: STATUS, search: false }, // Badge
{ title: "Category", dataIndex: "category", valueType: "select", valueEnum: CATEGORY },
{ title: "Created", dataIndex: "createdAt", valueType: "dateRange", hideInTable: true,
search: { transform: (v) => ({ from: v[0], to: v[1] }) } }, // filter only
{ title: "Actions", valueType: "option", width: 100,
render: (_, r) => [<a key="view" onClick={() => open(r)}>View</a>] },
];search: falsefor computed columns or long text.hideInTable: truefor fields used only to filter, such as a date range.- Use
valueEnum/valueTypeinstead ofrenderwhen you can: you get the Badge, the filter field, and the detail-page display for free.
Load data from the app’s API
request calls the generated API in app/api and returns { data, total, success }. When params changes, the table reloads.
const api = useApiClient();
<ProTable<Req>
rowKey="id"
columns={columns}
params={{ tab }}
request={async (p) => {
const r = await api.requests.list({
page: p.current, pageSize: p.pageSize,
status: tab === "all" ? undefined : tab,
category: p.category, search: p.title,
});
return { data: r.data, total: r.total, success: true };
}}
pagination={{ pageSize: 20, showTotal: (t) => `${t} requests` }}
/>When the table’s parameter names match the API (no renaming title to search or the tab to status), drop the hand-written request and use request={tableRequest(api.requests.list)} from app/hooks. For a standard list (status tabs, search, a create form, links to the detail page), use ResourceList from manh/shell instead (see Call the API from the UI).
Status tabs with counts
Tabs with counts show users how much work is left, more clearly than a status dropdown. Get the numbers from a stats API; the default tab is the signed-in role’s work (an approver lands on Pending).
toolbar={{
menu: {
type: "tab",
activeKey: tab,
onChange: (k) => setTab(k as Tab),
items: TABS.map((t) => ({
key: t.key,
label: <span>{t.label} <Badge count={counts?.[t.key]} /></span>,
})),
},
}}Select several rows to act at once
Turn on rowSelection only for roles that are allowed to act, and disable rows that can no longer be processed.
rowSelection={canApprove ? { getCheckboxProps: (r) => ({ disabled: r.status !== "pending" }) } : undefined}
tableAlertRender={({ selectedRows }) => <span><b>{selectedRows.length}</b> selected · total <b>{vnd(sum(selectedRows))}</b></span>}
tableAlertOptionRender={({ selectedRows, onCleanSelected }) => (
<Space><a onClick={onCleanSelected}>Clear selection</a><BulkApprove rows={selectedRows} /></Space>
)}Good to know
- An action column pinned to the right (
fixed: "right") needsscroll={{ x: 1100 }}on the table. - For a list that updates on its own:
polling={5000}(minimum 2000 ms). - The server must still check permissions and status on approval. Disabling a checkbox only keeps users from clicking by mistake.
Variants
Card list. When each record has an image or progress, use ProList as a grid.
// 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.List and detail side by side. A compact table on the left, the detail on the right:
<ProCard split="vertical">
<ProCard colSpan="384px" ghost>
<ProTable search={false} options={false} columns={columns} request={load}
onRow={(r) => ({ onClick: () => setId(r.id) })} />
</ProCard>
<ProCard title={current?.title}>{/* ProDescriptions + approve button */}</ProCard>
</ProCard>Inline-editable table. Use EditableProTable with editable={{ type: "multiple", editableKeys, onChange, onSave }}.
Next steps
- Detail pages — clicking View in the list opens this page.
- Forms — the New request button opens a form in a Drawer.
- Call the API from the UI —
useApiClient()and the generated API.