Skip to Content

Page recipes

How to combine components for common page types (dashboards, lists, long forms, settings, result pages) following ant-design-pro layouts, plus the old prop names to replace.

Each recipe is the order of blocks from top to bottom. Pick the recipe closest to the page you need, then replace the data and text with your app’s business. The example below is a store owner’s dashboard built from the first recipe.

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

Approver dashboard

Approvers open the app to see how much work is waiting. Their to-do list comes first, figures come after.

PageContainer greeting + number of pending items └── StatRow 3 figures, each with a secondary line └── Row gutter ├── Col lg={15} ProList: items to approve └── Col lg={9} breakdown chart

Analysis dashboard

Business owners review trends by period and compare groups.

Row 4 KPI cards: big number + small chart + footer metric Tabbed card sales / visits, date presets in tabBarExtraContent ├── Col xl={16} column chart └── Col xl={8} ranking list Row 2 half-width cards: top list, pie chart with Segmented

List page

PageContainer → ProTable (search fields, tabs with counts, a create button in toolBarRender, rowSelection with bulk actions). Clicking a row opens the detail page, or a Drawer size={600} with ProDescriptions for records with few fields. Details in List pages.

Card list

Product catalogs and projects: ProList grid={{ gutter: 16, column: 3 }} with metas: title, subTitle (Tag), avatar, description, content (progress), actions.

Long form with sections

ProForm wraps all PageContainer content ├── ProCard one card per section, 3 fields per row ├── EditableProTable line items └── FooterToolbar submit button + error list

Step form

PageContainer → ProCard → StepsForm: fill in → confirm (Descriptions + Alert) → Result status="success". See Forms.

Settings page

Two columns: on the left, a 224px Menu mode="inline" lists the sections; on the right, a ProForm layout="vertical" for the selected section, with a save button only.

app/settings/page.tsx
<Flex gap={24}> <Menu mode="inline" style={{ width: 224 }} selectedKeys={[section]} onClick={(e) => setSection(e.key)} items={SECTIONS} /> <ProForm layout="vertical" style={{ flex: 1 }} key={section} request={() => api.settings.list()} submitter={{ searchConfig: { submitText: "Save" }, resetButtonProps: false }} onFinish={async (v) => { await api.settings.put(v); message.success("Saved"); return true; }}> {/* … fields of the selected section */} </ProForm> </Flex>

Result and error pages

Result status="success" | "error" | "403" | "404" | "500" with one primary button, such as Back to list. Put it inside PageContainer so the user still sees the menu.

Old names to replace

Examples on the web often use old prop names. Use the name on the right of the arrow:

  • antd Card: bordered → variant; bodyStyle / headStyle → styles={{ body, header }}. ProCard and StatisticCard 2.x still use bodyStyle / bordered, so both names are correct there.
  • Modal / Drawer: visible → open; destroyOnClose → destroyOnHidden (see the reset note in Forms); Drawer width → size.
  • Tabs.TabPane / Menu.Item written as JSX → the items prop.
  • Space direction → orientation, split → separator. Steps direction → orientation, items.description → items.content.
  • Statistic valueStyle → styles.content. Alert message → title. Dropdown.Button / Button.Group → Space.Compact.
  • pro-components v3 names don’t exist in 2.8.10: use renderFormItem (not formItemRender); layout="mix" is still valid.

Good to know

  • Don’t copy createStyles, less, or className={styles.x} from ant-design-pro. Use tokens + inline style, Grid.useBreakpoint() instead of @media, plain strings instead of useIntl, and useNavigate instead of umi’s history.
  • Lay out columns of cards with Row gutter + Col, not ProCard gutter, which insets the cards from the full-width cards above and below.
  • antd List is deprecated as of 6.4. For new card grids, use ProList or Row / Col holding ProCard.

Next steps

Last updated