arco-design
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseArco Design React — Skills Reference
Arco Design React — 技能参考
@arco-design/web-react@arco-design/web-reactCritical Conventions
重要约定
Always follow these rules when writing Arco Design code:
- Imports: — always from the package root, never from sub-paths like
import { Button, Table, Form } from '@arco-design/web-react'@arco-design/web-react/es/Button - Icons:
import { IconSearch, IconPlus } from '@arco-design/web-react/icon' - Types:
import type { TableProps, FormInstance } from '@arco-design/web-react' - Styles: (full) or configure on-demand loading
import '@arco-design/web-react/dist/css/arco.css' - Date library: dayjs (NOT moment.js)
- Controlled mode: +
value; Uncontrolled:onChangedefaultValue - Sub-components: accessed via pattern —
Component.Sub,Form.Item,Select.Option,Menu.SubMenu,Input.Search,Input.TextArea,Grid.RowGrid.Col - Form.Item uses prop (not
fieldlike Ant Design)name - Switch in Form requires
triggerPropName="checked"
编写Arco Design代码时请始终遵循以下规则:
- 导入规则:— 始终从包根目录导入,不要从
import { Button, Table, Form } from '@arco-design/web-react'这类子路径导入@arco-design/web-react/es/Button - 图标导入:
import { IconSearch, IconPlus } from '@arco-design/web-react/icon' - 类型导入:
import type { TableProps, FormInstance } from '@arco-design/web-react' - 样式导入:(全量导入)或配置按需加载
import '@arco-design/web-react/dist/css/arco.css' - 日期库:dayjs(请勿使用moment.js)
- 受控模式:+
value;非受控模式:onChangedefaultValue - 子组件:通过的模式访问 — 例如
Component.Sub、Form.Item、Select.Option、Menu.SubMenu、Input.Search、Input.TextArea、Grid.RowGrid.Col - Form.Item使用属性(不像Ant Design那样使用
field)name - Form中的Switch组件需要设置
triggerPropName="checked"
Skill Index
技能索引
Load the relevant file below for full API reference, code examples, and best practices.
加载下方对应的文件即可获取完整的API参考、代码示例和最佳实践。
Setup & Configuration
安装与配置
| Topic | File | When to use |
|---|---|---|
| Installation | getting-started.md | Install |
| Global Config | config-provider.md | Set global component size, theme, locale, default props via |
| Theming | theming.md | Custom theme colors, CSS variable overrides, Less variables, dark mode toggle |
| Internationalization | internationalization.md | Switch languages, add locale packs, customize locale text |
| Architecture | architecture.md | Understand controlled/uncontrolled patterns, props merging, ref forwarding, CSS naming |
| 主题 | 文件 | 适用场景 |
|---|---|---|
| 安装 | getting-started.md | 安装 |
| 全局配置 | config-provider.md | 通过 |
| 主题配置 | theming.md | 自定义主题色、CSS变量覆盖、Less变量、深色模式切换 |
| 国际化 | internationalization.md | 切换语言、添加语言包、自定义本地化文本 |
| 架构设计 | architecture.md | 理解受控/非受控模式、属性合并、ref转发、CSS命名规范 |
General Components
通用组件
| Component | File | Use for |
|---|---|---|
| Button | button.md | Buttons, button groups, icon buttons, loading state |
| Icon | icon.md | Built-in icons ( |
| Typography | typography.md | Headings, paragraphs, text ellipsis, copyable/editable text |
| Link | link.md | Hyperlinks with icon, hover states |
| Divider | divider.md | Horizontal/vertical dividers, dividers with text |
| 组件 | 文件 | 用途 |
|---|---|---|
| Button | button.md | 按钮、按钮组、图标按钮、加载状态 |
| Icon | icon.md | 内置图标( |
| Typography | typography.md | 标题、段落、文本省略、可复制/可编辑文本 |
| Link | link.md | 带图标、hover效果的超链接 |
| Divider | divider.md | 水平/垂直分割线、带文本的分割线 |
Layout
布局
| Component | File | Use for |
|---|---|---|
| Grid | grid.md | 24-column |
| Layout | layout.md | Page skeleton: |
| Space | space.md | Consistent spacing between elements, horizontal/vertical, wrap |
| 组件 | 文件 | 用途 |
|---|---|---|
| Grid | grid.md | 24栅格 |
| Layout | layout.md | 页面骨架: |
| Space | space.md | 元素间统一间距设置、水平/垂直排列、自动换行 |
Navigation
导航
| Component | File | Use for |
|---|---|---|
| Menu | menu.md | Sidebar nav, top nav bar, sub-menus, menu groups, collapsible |
| Tabs | tabs.md | Tab switching, card tabs, editable/closable tabs, extra content |
| Dropdown | dropdown.md | Dropdown menus, context menus, button dropdowns |
| Breadcrumb | breadcrumb.md | Navigation hierarchy path, route breadcrumbs |
| Pagination | pagination.md | Page navigation, size changer, simple/mini mode |
| Steps | steps.md | Step-by-step workflows, vertical/dot steps, error state |
| Affix | affix.md | Pin element to viewport on scroll |
| Anchor | anchor.md | In-page anchor navigation, scroll-to-section |
| PageHeader | page-header.md | Page title + back button + breadcrumb + actions |
| 组件 | 文件 | 用途 |
|---|---|---|
| Menu | menu.md | 侧边栏导航、顶部导航栏、子菜单、菜单组、可折叠 |
| Tabs | tabs.md | 标签页切换、卡片式标签、可编辑/可关闭标签、额外内容区 |
| Dropdown | dropdown.md | 下拉菜单、上下文菜单、按钮下拉框 |
| Breadcrumb | breadcrumb.md | 导航层级路径、路由面包屑 |
| Pagination | pagination.md | 分页导航、每页数量切换、简洁/迷你模式 |
| Steps | steps.md | 分步流程、垂直/点状步骤条、错误状态 |
| Affix | affix.md | 滚动时将元素固定在视口内 |
| Anchor | anchor.md | 页内锚点导航、滚动到指定区块 |
| PageHeader | page-header.md | 页面标题+返回按钮+面包屑+操作区 |
Data Entry
数据录入
| Component | File | Use for |
|---|---|---|
| Form | form.md | Form building, validation, |
| Input | input.md | Text input, |
| Select | select.md | Dropdown select, multi-select, search, remote search, |
| DatePicker | date-picker.md | Date/range picker ( |
| TimePicker | time-picker.md | Time selection, range, 12h format, step intervals |
| InputNumber | input-number.md | Numeric input, stepper, precision, min/max |
| Checkbox | checkbox.md | Multi-select, |
| Radio | radio.md | Single select, |
| Switch | switch.md | Toggle switch, loading, text labels (use |
| Slider | slider.md | Range slider, marks, vertical, step, tooltip format |
| Rate | rate.md | Star rating, half-star, readonly, custom characters |
| Cascader | cascader.md | Multi-level cascade (province/city), remote load, search |
| TreeSelect | tree-select.md | Select from tree structure, checkable, searchable, async load |
| Transfer | transfer.md | Transfer items between two lists, search, simple mode |
| AutoComplete | auto-complete.md | Input autocomplete, search suggestions |
| Mentions | mentions.md | @mention users/topics in text input |
| InputTag | input-tag.md | Tag input, add/remove tags, drag sort |
| Upload | upload.md | File upload, drag-and-drop, image upload with preview |
| ColorPicker | color-picker.md | Color selection (hex/rgb/hsl) |
| VerificationCode | verification-code.md | OTP / verification code input |
| 组件 | 文件 | 用途 |
|---|---|---|
| Form | form.md | 表单搭建、校验、 |
| Input | input.md | 文本输入框、 |
| Select | select.md | 下拉选择、多选、搜索、远程搜索、 |
| DatePicker | date-picker.md | 日期/范围选择器( |
| TimePicker | time-picker.md | 时间选择、范围选择、12小时制、步长间隔 |
| InputNumber | input-number.md | 数值输入、步进器、精度设置、最大值/最小值限制 |
| Checkbox | checkbox.md | 多选、 |
| Radio | radio.md | 单选、 |
| Switch | switch.md | 开关切换、加载状态、文本标签(Form中使用时需设置 |
| Slider | slider.md | 范围滑块、刻度标记、垂直模式、步长、提示框格式化 |
| Rate | rate.md | 星级评分、半星、只读模式、自定义字符 |
| Cascader | cascader.md | 多级联动选择(省/市)、远程加载、搜索 |
| TreeSelect | tree-select.md | 树形结构选择、可勾选、可搜索、异步加载 |
| Transfer | transfer.md | 双列表穿梭框、搜索、简洁模式 |
| AutoComplete | auto-complete.md | 输入自动补全、搜索建议 |
| Mentions | mentions.md | 文本输入中@提及用户/话题 |
| InputTag | input-tag.md | 标签输入、添加/删除标签、拖拽排序 |
| Upload | upload.md | 文件上传、拖拽上传、带预览的图片上传 |
| ColorPicker | color-picker.md | 颜色选择(hex/rgb/hsl格式) |
| VerificationCode | verification-code.md | OTP/验证码输入框 |
Data Display
数据展示
| Component | File | Use for |
|---|---|---|
| Table | table.md | Data tables, sort, filter, pagination, fixed columns/header, virtual scroll, row selection, expandable rows |
| List | list.md | Data lists, paginated, virtual scroll, grid layout |
| Card | card.md | Card containers, cover, |
| Tree | tree.md | Tree structure, checkable, draggable, virtual scroll, async load |
| Tooltip | tooltip.md | Hover text hints (for rich content use Popover) |
| Popover | popover.md | Click/hover popup cards with rich content |
| Avatar | avatar.md | User avatars, avatar groups, image/text/icon avatars |
| Badge | badge.md | Numeric badges, status dots, count indicators |
| Tag | tag.md | Status tags, closable, |
| Carousel | carousel.md | Image carousels, slideshows |
| Collapse | collapse.md | Collapsible panels, accordion mode, FAQ |
| Descriptions | descriptions.md | Key-value detail display, bordered, responsive columns |
| Calendar | calendar.md | Calendar view, event marking |
| Comment | comment.md | Comment display, nested replies, actions |
| Empty | empty.md | Empty state placeholder |
| Image | image.md | Image display, preview, lazy load, |
| Statistic | statistic.md | Numeric display, countdown, trend indicators |
| Timeline | timeline.md | Timelines, activity feeds, changelog |
| 组件 | 文件 | 用途 |
|---|---|---|
| Table | table.md | 数据表格、排序、筛选、分页、固定列/表头、虚拟滚动、行选择、可展开行 |
| List | list.md | 数据列表、分页、虚拟滚动、网格布局 |
| Card | card.md | 卡片容器、封面、 |
| Tree | tree.md | 树形结构展示、可勾选、可拖拽、虚拟滚动、异步加载 |
| Tooltip | tooltip.md | hover文字提示(富内容请使用Popover) |
| Popover | popover.md | 点击/hover弹出的富内容卡片 |
| Avatar | avatar.md | 用户头像、头像组、图片/文字/图标头像 |
| Badge | badge.md | 数字徽标、状态点、计数指示器 |
| Tag | tag.md | 状态标签、可关闭、 |
| Carousel | carousel.md | 图片轮播、幻灯片 |
| Collapse | collapse.md | 可折叠面板、手风琴模式、FAQ |
| Descriptions | descriptions.md | 键值对详情展示、带边框、响应式列数 |
| Calendar | calendar.md | 日历视图、事件标记 |
| Comment | comment.md | 评论展示、嵌套回复、操作区 |
| Empty | empty.md | 空状态占位符 |
| Image | image.md | 图片展示、预览、懒加载、 |
| Statistic | statistic.md | 数值展示、倒计时、趋势指示器 |
| Timeline | timeline.md | 时间线、动态流、更新日志 |
Feedback
反馈
| Component | File | Use for |
|---|---|---|
| Modal | modal.md | Modal dialogs, |
| Message | message.md | Global toast: |
| Notification | notification.md | Rich notification toasts with title + content + actions |
| Drawer | drawer.md | Slide-out side panels, form editing, nested drawers |
| Alert | alert.md | Inline alert banners (info/success/warning/error), banner mode |
| Progress | progress.md | Linear/circular progress bars, step progress |
| Popconfirm | popconfirm.md | Lightweight confirmation popup before delete/submit |
| Result | result.md | Result pages (success/fail/403/404/500) |
| Skeleton | skeleton.md | Loading skeleton placeholders with animation |
| Spin | spin.md | Loading spinner wrapping content |
| 组件 | 文件 | 用途 |
|---|---|---|
| Modal | modal.md | 模态弹窗、 |
| Message | message.md | 全局轻提示: |
| Notification | notification.md | 带标题+内容+操作的富内容通知提示 |
| Drawer | drawer.md | 滑出侧边面板、表单编辑、嵌套抽屉 |
| Alert | alert.md | 内联警告栏(信息/成功/警告/错误)、通栏模式 |
| Progress | progress.md | 线性/环形进度条、分步进度 |
| Popconfirm | popconfirm.md | 删除/提交前的轻量确认弹窗 |
| Result | result.md | 结果页(成功/失败/403/404/500) |
| Skeleton | skeleton.md | 带动画的加载骨架屏占位符 |
| Spin | spin.md | 包裹内容的加载指示器 |
Other
其他
| Component | File | Use for |
|---|---|---|
| BackTop | back-top.md | Scroll-to-top button |
| Portal | portal.md | Render children into different DOM node |
| ResizeBox | resize-box.md | Resizable containers, split panes |
| Trigger | trigger.md | Base popup positioning (underlies Tooltip/Popover/Dropdown) |
| Watermark | watermark.md | Text/image watermarks over page content |
| 组件 | 文件 | 用途 |
|---|---|---|
| BackTop | back-top.md | 回到顶部按钮 |
| Portal | portal.md | 将子元素渲染到其他DOM节点 |
| ResizeBox | resize-box.md | 可调整大小的容器、分割面板 |
| Trigger | trigger.md | 基础弹窗定位能力(Tooltip/Popover/Dropdown的底层依赖) |
| Watermark | watermark.md | 页面内容上的文字/图片水印 |
Patterns & Best Practices
模式与最佳实践
| Topic | File | When to use |
|---|---|---|
| Form Patterns | form-patterns.md | Dynamic forms, linked validation, nested forms, async submit, complex layouts |
| Table Patterns | table-patterns.md | Remote data, editable rows, virtual scroll large data, custom filters |
| Modal Patterns | modal-patterns.md | Form-in-modal, confirmation flows, nested drawers, global messages |
| Controlled vs Uncontrolled | controlled-uncontrolled.md | Choosing |
| Responsive Design | responsive-design.md | Grid breakpoints, adaptive layout, mobile-friendly design |
| 主题 | 文件 | 适用场景 |
|---|---|---|
| 表单最佳实践 | form-patterns.md | 动态表单、联动校验、嵌套表单、异步提交、复杂布局 |
| 表格最佳实践 | table-patterns.md | 远程数据、可编辑行、大数据虚拟滚动、自定义筛选 |
| 弹窗最佳实践 | modal-patterns.md | 弹窗内表单、确认流程、嵌套抽屉、全局提示 |
| 受控vs非受控模式 | controlled-uncontrolled.md | 选择 |
| 响应式设计 | responsive-design.md | 栅格断点、自适应布局、移动端适配 |
Hooks
Hooks
Import from . Use these headless hooks only when you need a fully custom UI — otherwise prefer the corresponding component.
@arco-design/web-react/hooks| Hook | File | Use for |
|---|---|---|
| useVerificationCode | use-verification-code.md | Custom OTP input with focus, paste, keyboard navigation |
| useWatermark | use-watermark.md | Dynamic canvas watermark with tamper protection |
从导入。仅当你需要完全自定义UI时使用这些无头钩子 — 否则优先使用对应的组件。
@arco-design/web-react/hooks| 钩子 | 文件 | 用途 |
|---|---|---|
| useVerificationCode | use-verification-code.md | 自定义验证码输入,支持聚焦、粘贴、键盘导航 |
| useWatermark | use-watermark.md | 带防篡改能力的动态画布水印 |