ant-design-react
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWhen to use this skill
何时使用本技能
Use this skill whenever the user wants to:
- Build React applications with Ant Design components
- Use Ant Design UI components (Button, Form, Table, Input, Select, etc.)
- Customize Ant Design theme and styles
- Implement internationalization (i18n) with Ant Design
- Use Ant Design with TypeScript
- Create forms with validation
- Display data in tables and lists
- Implement navigation and layout
- Use Ant Design icons
- Handle user feedback (Modal, Message, Notification)
- Implement data visualization components
- Use Ant Design design tokens and design system
当用户有以下需求时,即可使用本技能:
- 使用Ant Design组件构建React应用
- 使用Ant Design UI组件(Button、Form、Table、Input、Select等)
- 自定义Ant Design主题与样式
- 结合Ant Design实现国际化(i18n)
- 在Ant Design中使用TypeScript
- 创建带验证的表单
- 在表格与列表中展示数据
- 实现导航与布局
- 使用Ant Design图标
- 处理用户反馈(Modal、Message、Notification)
- 实现数据可视化组件
- 使用Ant Design设计令牌与设计系统
How to use this skill
如何使用本技能
This skill is organized to match the Ant Design React official documentation structure (https://4x-ant-design.antgroup.com/docs/react/introduce-cn, https://4x-ant-design.antgroup.com/components/overview-cn/). When working with Ant Design React:
-
Identify the topic from the user's request:
- Getting started/快速开始 → or
examples/getting-started/installation.mdexamples/getting-started/basic-usage.md - Button/按钮 →
examples/components/button.md - Form/表单 →
examples/components/form.md - Table/表格 →
examples/components/table.md - Input/输入框 →
examples/components/input.md - Select/选择器 →
examples/components/select.md - DatePicker/日期选择器 →
examples/components/date-picker.md - Modal/对话框 →
examples/components/modal.md - Layout/布局 →
examples/components/layout.md - Menu/菜单 →
examples/components/menu.md - Theme customization/主题定制 →
examples/advanced/theme-customization.md - Internationalization/国际化 →
examples/advanced/internationalization.md - TypeScript/类型支持 →
examples/advanced/typescript.md
- Getting started/快速开始 →
-
Load the appropriate example file from thedirectory:
examples/Getting Started (快速开始) -:examples/getting-started/- - Installing Ant Design and basic setup
examples/getting-started/installation.md - - Basic component usage
examples/getting-started/basic-usage.md
Components (组件) -:examples/components/- - Button component
examples/components/button.md - - Input component
examples/components/input.md - - Form component with validation
examples/components/form.md - - Table component
examples/components/table.md - - Select component
examples/components/select.md - - DatePicker component
examples/components/date-picker.md - - Modal component
examples/components/modal.md - - Layout component
examples/components/layout.md - - Menu component
examples/components/menu.md - - Icon component
examples/components/icon.md - - Typography component
examples/components/typography.md - - Grid component
examples/components/grid.md - - Space component
examples/components/space.md - - Card component
examples/components/card.md - - Tabs component
examples/components/tabs.md - - Pagination component
examples/components/pagination.md - - Upload component
examples/components/upload.md - - Upload component
examples/components/upload.md - - Message component
examples/components/message.md - - Notification component
examples/components/notification.md - - Alert component
examples/components/alert.md - - Spin component
examples/components/spin.md - - Progress component
examples/components/progress.md
Advanced (高级) -:examples/advanced/- - Customizing theme
examples/advanced/theme-customization.md - - Internationalization setup
examples/advanced/internationalization.md - - TypeScript support
examples/advanced/typescript.md
-
Follow the specific instructions in that example file for syntax, structure, and best practicesImportant Notes:
- All examples follow Ant Design React 4.x API
- Examples include both JavaScript and TypeScript versions where applicable
- Each example file includes key concepts, code examples, and key points
- Always check the example file for best practices and common patterns
-
Reference API documentation in thedirectory when needed:
api/- - Component API reference
api/components.md - - ConfigProvider API
api/config-provider.md - - Design tokens API
api/design-tokens.md
-
Use templates from thedirectory:
templates/- - Project setup templates
templates/project-setup.md - - Component usage templates
templates/component-template.md
本技能的组织结构与Ant Design React官方文档结构一致(https://4x-ant-design.antgroup.com/docs/react/introduce-cn, https://4x-ant-design.antgroup.com/components/overview-cn/)。使用Ant Design React时:
-
从用户的请求中确定主题:
- Getting started/快速开始 → 或
examples/getting-started/installation.mdexamples/getting-started/basic-usage.md - Button/按钮 →
examples/components/button.md - Form/表单 →
examples/components/form.md - Table/表格 →
examples/components/table.md - Input/输入框 →
examples/components/input.md - Select/选择器 →
examples/components/select.md - DatePicker/日期选择器 →
examples/components/date-picker.md - Modal/对话框 →
examples/components/modal.md - Layout/布局 →
examples/components/layout.md - Menu/菜单 →
examples/components/menu.md - Theme customization/主题定制 →
examples/advanced/theme-customization.md - Internationalization/国际化 →
examples/advanced/internationalization.md - TypeScript/类型支持 →
examples/advanced/typescript.md
- Getting started/快速开始 →
-
从目录中加载对应的示例文件:
examples/Getting Started (快速开始) -:examples/getting-started/- - Ant Design的安装与基础配置
examples/getting-started/installation.md - - 组件基础使用方法
examples/getting-started/basic-usage.md
Components (组件) -:examples/components/- - Button组件
examples/components/button.md - - Input组件
examples/components/input.md - - 带验证的Form组件
examples/components/form.md - - Table组件
examples/components/table.md - - Select组件
examples/components/select.md - - DatePicker组件
examples/components/date-picker.md - - Modal组件
examples/components/modal.md - - Layout组件
examples/components/layout.md - - Menu组件
examples/components/menu.md - - Icon组件
examples/components/icon.md - - Typography组件
examples/components/typography.md - - Grid组件
examples/components/grid.md - - Space组件
examples/components/space.md - - Card组件
examples/components/card.md - - Tabs组件
examples/components/tabs.md - - Pagination组件
examples/components/pagination.md - - Upload组件
examples/components/upload.md - - Upload组件
examples/components/upload.md - - Message组件
examples/components/message.md - - Notification组件
examples/components/notification.md - - Alert组件
examples/components/alert.md - - Spin组件
examples/components/spin.md - - Progress组件
examples/components/progress.md
Advanced (高级) -:examples/advanced/- - 主题定制
examples/advanced/theme-customization.md - - 国际化配置
examples/advanced/internationalization.md - - TypeScript支持
examples/advanced/typescript.md
-
遵循该示例文件中的具体说明,包括语法、结构和最佳实践重要说明:
- 所有示例均遵循Ant Design React 4.x API
- 适用的示例包含JavaScript和TypeScript两种版本
- 每个示例文件都包含核心概念、代码示例和关键点
- 请务必查看示例文件中的最佳实践与通用模式
-
必要时参考目录中的API文档:
api/- - 组件API参考
api/components.md - - ConfigProvider API
api/config-provider.md - - 设计令牌API
api/design-tokens.md
-
使用目录中的模板:
templates/- - 项目配置模板
templates/project-setup.md - - 组件使用模板
templates/component-template.md
Doc mapping (one-to-one with official documentation)
文档映射(与官方文档一一对应)
Guide (指南):
- See guide files in or
examples/guide/→ https://4x-ant-design.antgroup.com/docs/react/introduce-cnexamples/getting-started/
Components (组件):
- See component files in → https://4x-ant-design.antgroup.com/components/overview-cn/
examples/components/
Guide (指南):
- 查看或
examples/guide/中的指南文件 → https://4x-ant-design.antgroup.com/docs/react/introduce-cnexamples/getting-started/
Components (组件):
- 查看中的组件文件 → https://4x-ant-design.antgroup.com/components/overview-cn/
examples/components/
Examples and Templates
示例与模板
This skill includes detailed examples organized to match the official documentation structure. All examples are in the directory (see mapping above).
examples/To use examples:
- Identify the topic from the user's request
- Load the appropriate example file from the mapping above
- Follow the instructions, syntax, and best practices in that file
- Adapt the code examples to your specific use case
To use templates:
- Reference templates in directory for common scaffolding
templates/ - Adapt templates to your specific needs and coding style
本技能包含详细的示例,其组织结构与官方文档一致。所有示例均位于目录中(请参考上述映射关系)。
examples/使用示例的方法:
- 从用户的请求中确定主题
- 根据上述映射关系加载对应的示例文件
- 遵循文件中的说明、语法和最佳实践
- 根据具体需求调整代码示例
使用模板的方法:
- 参考目录中的模板进行通用脚手架搭建
templates/ - 根据具体需求和编码风格调整模板
API Reference
API参考
Detailed API documentation is available in the directory, organized to match the official Ant Design React API documentation structure:
api/详细的API文档位于目录中,其组织结构与Ant Design React官方API文档一致:
api/Components API (api/components.md
)
api/components.md组件API (api/components.md
)
api/components.md- All component props and APIs
- Component methods and events
- Component types and interfaces
- 所有组件的属性与API
- 组件方法与事件
- 组件类型与接口
ConfigProvider API (api/config-provider.md
)
api/config-provider.mdConfigProvider API (api/config-provider.md
)
api/config-provider.md- ConfigProvider component API
- Global configuration options
- Locale configuration
- ConfigProvider组件API
- 全局配置选项
- 区域设置配置
Design Tokens API (api/design-tokens.md
)
api/design-tokens.md设计令牌API (api/design-tokens.md
)
api/design-tokens.md- Design tokens reference
- Theme customization tokens
- CSS variables
To use API reference:
- Identify the API you need help with
- Load the corresponding API file from the directory
api/ - Find the API signature, parameters, return type, and examples
- Reference the linked example files for detailed usage patterns
- All API files include links to relevant example files in the directory
examples/
- 设计令牌参考
- 主题定制令牌
- CSS变量
使用API参考的方法:
- 确定需要帮助的API
- 从目录中加载对应的API文件
api/ - 查找API签名、参数、返回类型和示例
- 参考关联的示例文件获取详细使用模式
- 所有API文件均包含指向目录中相关示例文件的链接
examples/
Best Practices
最佳实践
- Import styles: Import Ant Design CSS in your entry file
- Use ConfigProvider: Wrap your app with ConfigProvider for global configuration
- Form validation: Use Form component with validation rules
- TypeScript: Use TypeScript for better type safety
- Theme customization: Use design tokens for consistent theming
- Internationalization: Use ConfigProvider with locale for i18n
- Component composition: Compose components for complex UIs
- Performance: Use React.memo and useMemo for optimization
- Accessibility: Follow Ant Design accessibility guidelines
- Responsive design: Use Grid and responsive utilities
- 导入样式: 在入口文件中导入Ant Design CSS
- 使用ConfigProvider: 用ConfigProvider包裹应用以进行全局配置
- 表单验证: 使用带验证规则的Form组件
- TypeScript: 使用TypeScript以获得更好的类型安全性
- 主题定制: 使用设计令牌实现一致的主题
- 国际化: 结合ConfigProvider与区域设置实现i18n
- 组件组合: 通过组件组合构建复杂UI
- 性能优化: 使用React.memo和useMemo进行优化
- 可访问性: 遵循Ant Design可访问性指南
- 响应式设计: 使用Grid和响应式工具
Resources
资源
- Official Website: https://4x-ant-design.antgroup.com/index-cn
- Getting Started: https://4x-ant-design.antgroup.com/docs/react/introduce-cn
- Components: https://4x-ant-design.antgroup.com/components/overview-cn/
- GitHub Repository: https://github.com/ant-design/ant-design
Keywords
关键词
Ant Design, Ant Design React, antd, React UI library, components, Button, Form, Table, Input, Select, DatePicker, Modal, Layout, Menu, theme, customization, internationalization, i18n, TypeScript, design system, 组件库, 按钮, 表单, 表格, 输入框, 选择器, 日期选择器, 对话框, 布局, 菜单, 主题, 国际化, 类型支持
Ant Design, Ant Design React, antd, React UI库, 组件, Button, Form, Table, Input, Select, DatePicker, Modal, Layout, Menu, 主题, 定制, 国际化, i18n, TypeScript, 设计系统, 组件库, 按钮, 表单, 表格, 输入框, 选择器, 日期选择器, 对话框, 布局, 菜单, 主题, 国际化, 类型支持