Features
- Multiple Layout Modes: Side menu, top menu, and mixed layouts
- Responsive Design: Automatic adaptation for mobile and desktop
- Menu Management: Dynamic menu generation from route configuration
- Breadcrumbs: Automatic breadcrumb navigation
- Theme Customization: Light, dark, and custom themes
- Header Actions: User info, notifications, settings
- Page Container: Built-in page header with tabs and actions
Basic Usage
Layout Modes
Menu Configuration
Define your application’s menu structure using route configuration:Dynamic Menu
Load menu configuration from API:PageContainer
PageContainer provides a consistent page header with breadcrumbs, title, and actions:Header Configuration
Custom Header Content
Header Actions
Footer
Theme Customization
Built-in Themes
Token Customization
Settings Drawer
Provide a settings panel for users to customize the layout:Mobile Support
ProLayout automatically adapts to mobile screens:Breadcrumbs
Automatic breadcrumb generation:Multi-tab Pages
Implement multi-tab functionality:Integration with React Router
Key Props
| Prop | Type | Description |
|---|---|---|
title | ReactNode | Application title |
logo | ReactNode | Logo image or component |
route | RouteConfig | Menu route configuration |
layout | 'side' | 'top' | 'mix' | Layout mode |
navTheme | 'light' | 'dark' | 'realDark' | Navigation theme |
location | { pathname: string } | Current location |
menuItemRender | (item, dom) => ReactNode | Custom menu item render |
rightContentRender | () => ReactNode | Header right content |
footerRender | () => ReactNode | Footer render |
collapsed | boolean | Sidebar collapsed state |
onCollapse | (collapsed) => void | Collapse change handler |
PageContainer Props
| Prop | Type | Description |
|---|---|---|
title | ReactNode | Page title |
subTitle | ReactNode | Page subtitle |
extra | ReactNode | Extra actions |
content | ReactNode | Content area |
breadcrumb | BreadcrumbProps | Breadcrumb config |
tabList | TabItem[] | Tab list |
tabActiveKey | string | Active tab key |
onTabChange | (key) => void | Tab change handler |
Best Practices
Use route-based menu configuration
Use route-based menu configuration
Implement permission control
Implement permission control
Filter menu items based on user permissions:
Optimize for mobile
Optimize for mobile
Test your layout on mobile devices and adjust breakpoints and collapsed behavior accordingly.
Persist layout settings
Persist layout settings
Save user’s layout preferences to localStorage: