Read it before migration
If you want to migrate to Ant Design 5.0, please check V4 to V5.
Major Changes
- New Components
- FloatButton component, and refactor BackTop as child component of FloatButton. #37520 @li-jia-nan
- Tour component. #37867 #38469 @heiyu4585
- New Component Variants
- DatePicker add
presets
to support preset ranges for quick selection. #38249 - Progress
circle
type support responsiveformat
text for small size. #38231 @li-jia-nan - Steps add
inline
type. #38311 @JarvisArt
- DatePicker add
- New Design
- Change primary color to
#1677ff
. #37254 - Change basic border radius to
6px
, and support gradient radius. #37146 #37369 - Optimize transition duration. #37438
- Optimize padding and remove border for some components. #37283
- Optimize focus style for some components. #37483
- Optimize style with large border radius.
- Optimize Switch transition. #37658
- Optimize Anchor ink ball style. #38616
- Change primary color to
- Export object
theme
which contains hooks and algorithms related with theme. #36302 - ConfigProvider support
theme
prop to modify theme configuration. For more: Customize Theme. - Add
locale
directory in package, which contains commonjs locale files. #38194 @chunsch - Do not support IE browser anymore.
- Remove package
antd/lib
. #36362- Change
main
inpackage.json
todist/antd.js
. eb8835f
- Change
- Remove
dist/antd.css
, and adddist/reset.css
to override common styles. #36224 - Deprecate
visible
and provideopen
instead in components below. @yykoypj- Tag deprecate
visible
. #36671 - Table deprecate
filterDropdownVisible
and providefilterDropdownOpen
. #36747 - Drawer deprecate
visible
and provideopen
instead. #36750 - Modal deprecate
visible
and provideopen
instead. #36774 - Dropdown deprecate
visible
and provideopen
instead. #36799 - Tooltip deprecate
visible
and provideopen
instead, Popover and Popconfirm. #36807
- Tag deprecate
- Deprecate
dropdownClassName
and providepopupClassName
instead in components below. @heiyu4585- AutoComplete deprecate
dropdownClassName
and providepopupClassName
instead. #37087 - Mentions deprecate
dropdownClassName
and providepopupClassName
instead. #37122 - Cascader deprecate
dropdownClassName
and providepopupClassName
instead. #37089 - Select deprecate
dropdownClassName
and providepopupClassName
instead. #37091 - TreeSelect deprecate
dropdownClassName
and providepopupClassName
instead. #37092 - DatePicker and TimePicker deprecate
dropdownClassName
and providepopupClassName
instead. #37207
- AutoComplete deprecate
- Refactor styles with CSS-in-JS for all components.
- Remove less and css in package. #36244
- Change date library from Moment.js to Day.js, for more: Use custom date library. b22815d @iamkun
- React Notification to support React 18 concurrent mode and refactor useNotification hook,which is preferred instead of static function. #35423 #35568
- Slider props related with Tooltip are unified into
tooltip
. #37043 @yykoypj - Migrate official site to dumi@2. #38328
- Ant Design 5.0.0 已发布!欢迎阅读我们的 发布文档。
升级必读 - 如果你想升级到 Ant Design 5.0,请仔细查阅我们的迁移文档。
主要变化 - 新增组件
- FloatButton 悬浮按钮,原 BackTop 移至 FloatButton 子组件。#37520 @li-jia-nan
- Tour 漫游式引导。#37867 #38469 @heiyu4585
- 新增组件变体
- DatePicker 新增
presets
属性用于预设时间范围快捷选择。#38249 - Progress
circle
类型支持小尺寸自适应。#38231 @li-jia-nan - Steps 新增
inline
类型。#38311 @JarvisArt
- DatePicker 新增
- 设计变化
- 新增导出对象
theme
,用于获取主题相关属性。#36302 - ConfigProvider 新增
theme
属性,用于更改主题配置,详情:定制主题。 - 产物新增
locale
目录,内含 cjs 格式的语言文件。#38194 @chunsch - 移除对 IE 的支持。
- 移除
lib
产物。#36362- 调整
package.json
中main
为dist/antd.js
。eb8835f
- 调整
- 移除
dist/antd.css
产物。默认不再入侵全局样式,新增dist/reset.css
用于重置部分常见样式。#36224 - 废弃下列组件的
visible
属性,改用open
。@yykoypj - 废弃下列组件的
dropdownClassName
,统一为popupClassName
。@heiyu4585- AutoComplete 废弃
dropdownClassName
,改用popupClassName
。#37087 - Mentions 废弃
dropdownClassName
,改用popupClassName
。#37122 - Cascader 废弃
dropdownClassName
,改用popupClassName
。#37089 - Select 废弃
dropdownClassName
,改用popupClassName
。#37091 - TreeSelect 废弃
dropdownClassName
,改用popupClassName
。#37092 - DatePicker 和 TimePicker 废弃
dropdownClassName
,改用popupClassName
。#37207
- AutoComplete 废弃
- 所有组件使用 CSS-in-JS 重构样式。
- 移除 less 及相关 less 和 css 产物。#36244
- 内置时间库由 Moment.js 替换为 Day.js,详情:使用自定义日期库。b22815d @iamkun
- 重构 Notification 以支持 React 18 concurrent 模式,并重构 useNotification hook,推荐替代静态方法使用。#35423 #35568
- Slider 组件 Tooltip 相关 API 合并至
tooltip
属性中。#37043 @yykoypj - 文档站技术栈迁移 dumi@2。#38328