Prerequisites
Before installing ProComponents, ensure your project meets these requirements:React
Version 18.0.0 or higher
Ant Design
Version 6.0.0 or higher
ProComponents is built on top of Ant Design and requires it as a peer dependency. Both React and React DOM must be installed in your project.
Installation
Install ProComponents using your preferred package manager:Installing Peer Dependencies
If you haven’t already installed Ant Design and React in your project, you’ll need to install them as well:Package Contents
The@ant-design/pro-components package is an all-in-one bundle that includes:
- ProTable - Advanced data table component
- ProForm - Enhanced form components with multiple layouts
- ProLayout - Complete page layout solution
- ProCard - Statistics and checkable card components
- ProList - Advanced list component with toolbar
- ProDescriptions - Enhanced descriptions component
- ProField - Unified field rendering component
- ProSkeleton - Loading skeleton components
- ProProvider - Global configuration provider
- Utilities - Helper functions and hooks
ProComponents uses a monorepo structure, but you only need to install one package. All components are exported from
@ant-design/pro-components.TypeScript Support
ProComponents is written in TypeScript and includes comprehensive type definitions out of the box. No additional@types packages are needed.
Import Styles
ProComponents automatically inherits Ant Design’s styles. Make sure you import Ant Design’s CSS in your application:Module Formats
ProComponents supports multiple module formats for different build tools:- ES Modules (Recommended)
- CommonJS
- UMD (Browser)
es/index.jsBenefits: Tree-shaking support, smaller bundle sizeBundle Size Optimization
ProComponents supports tree-shaking when using ES modules with modern build tools:Most modern bundlers (Vite, Webpack 5+) automatically tree-shake unused code when you import from the main package entry point.
Verification
Verify your installation by creating a simple component:Configuration Files
Depending on your build tool, you may need additional configuration:- Vite
- Next.js
- Create React App
- Webpack
vite.config.ts
Troubleshooting
Module not found: @ant-design/pro-components
Module not found: @ant-design/pro-components
Make sure you’ve installed the package correctly:If it’s not listed, reinstall:
React version mismatch errors
React version mismatch errors
ProComponents requires React 18+. Check your React version:If needed, upgrade:
Ant Design peer dependency warnings
Ant Design peer dependency warnings
ProComponents requires Ant Design 6.x. Install the correct version:
CSS styles not loading
CSS styles not loading
Make sure you’ve imported Ant Design’s CSS:Place this import at the top of your main entry file (e.g.,
main.tsx or App.tsx).TypeScript errors
TypeScript errors
If you encounter TypeScript errors, ensure your
tsconfig.json includes:Next Steps
Quick Start
Build your first ProComponents application
Components Overview
Explore all available components