Page recipes
Page recipes (ant-design-pro compositions)
- Approver dashboard / workplace: PageContainer (greeting + to-do count) → StatisticCard.Group (3) →
ProCard gutter wrap: to-do ProList (lg 15) + breakdown chart (lg 9). - Analysis dashboard: Row of 4 KPI cards (big number + tiny chart + footer metric) → tabbed card (sales/visits) with date presets in
tabBarExtraContent+ Column chart (xl 16) + ranking list (xl 8) → two half-width cards (top list, proportion pie withSegmented). - Table list: PageContainer → ProTable (search, tabs with counts,
toolBarRendercreate,rowSelection+ alert actions) → row click → detail route (orDrawer size={600}with ProDescriptions for light records). - Card list (catalogs, projects):
ProList grid={{ gutter: 16, column: 3 }}withmetas(title, subTitle tag, avatar, description, content progress, actions on hover). - Advanced form:
ProFormwrapping PageContainer content → severalProCardsections with 3 fields per row →EditableProTablefor line items →FooterToolbarwith submit + error popover. - Step form: PageContainer → ProCard →
StepsForm(fill → confirm withDescriptions+Alert→Result success). - Detail / profile: Detail pages.
- Settings: two columns — left
Menu mode="inline"(224px, sections), rightProForm layout="vertical"per section with submit-only submitter. - Result / exception:
Result status="success|error|403|404|500"+ primary action.
Deprecated names you will see in examples (use the right column)
- antd
Card:bordered→variant,bodyStyle/headStyle→styles={{ body, header }}(gated). ProCard/StatisticCard 2.x keepbodyStyle/bordered— they are valid there. Modal/Drawer:visible→open,destroyOnClose→destroyOnHidden(see Forms — reset caveat), Drawerwidth→size.Tabs.TabPane/Menu.ItemJSX →items(gated).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 on 2.8.10: use
renderFormItem(notformItemRender),layout="mix"is still valid. - antd
Listis deprecated in 6.4 (dev warning; ProList wraps it — fine). For new card grids preferProListorRow/ColofProCard. - Don’t port
createStyles/less/className={styles.x}from ant-design-pro: use tokens + inlinestyle,Grid.useBreakpoint()instead of@media, plain strings instead ofuseIntl,useNavigateinstead of umihistory.
Last updated on