github NG-ZORRO/ng-zorro-antd 21.0.0

one day ago

21.0.0

2026-01-09

Code Refactoring

  • migrate to native animation API, feel free to remove the @angular/animations dependency

Features

  • color-picker: support nzPresets (#9341) (d59ec99)
  • core: add provideNzNoAnimation (#9555) (c945e81)
  • date-picker: output date range in correct order (#9518) (d0b3185)
  • float-button: add pop animation to float button menu (#9413) (b40ad91)
  • input-number: supports mouse wheel control (#9591) (6ce3545)
  • input,input-number: add additional options for focus method (#9595) (c336711)
  • qrcode: support nzType and nzBoostLevel, delete array usage of nzPadding (#9535) (5419b51)
  • tree-view: upgrade tree view component (#9003) (ae9ad57)
  • upload: add nzMaxCount feature (#9424) (0bf13c3)

Bug Fixes

  • i18n: add missing translations to fa_IR (#9615) (1e8845d)
  • popconfirm: allow null for nzIcon hide icon (#9569) (760b587)
  • select: disable nzAutoClearSearchValue in single mode (#9605) (4720c21)
  • tree: no preventDefault when right-clicking the node title (#9532) (900efad)

⚠ BREAKING CHANGES

  • back-top: removed, please use float-button instead
  • color-picker: change DOM structure to be simpler, and remove no unnecessary payload of nzClick output
  • input-number-legacy: removed, please use input-number instead
  • qrcode: change the type of nzPadding from number | number[] to number (#9535)
  • statistic: rename NzStatisticNumberComponent to NzStatisticContentValueComponent
  • tabs: remove deprecated nz-tabset selector (#9613)
  • tree-view: nzTreeControl has been removed, please use nzLevelAccessor or nzChildrenAccessor instead
  • watermark: change import path from ng-zorro-antd/water-mark to ng-zorro-antd/watermark

Remove the following APIs which were marked as deprecated in the previous version:

Module API
ng-zorro-antd/back-top *
ng-zorro-antd/dropdown NzDropdownButtonDirective
ng-zorro-antd/input-number-legacy *
ng-zorro-antd/core NzHighlightModule
ng-zorro-antd/auto-complete NZ_AUTOCOMPLETE_VALUE_ACCESSOR
ng-zorro-antd/checkbox nz-checkbox-wrapper
ng-zorro-antd/date-picker NzDatePickerComponent#nzBorderless
ng-zorro-antd/input NzInputDirective#nzBorderless
ng-zorro-antd/input-number NzInputNumberComponent#nzBordered
ng-zorro-antd/mention NZ_MENTION_TRIGGER_ACCESSOR
ng-zorro-antd/select NzSelectComponent#nzBorderless
ng-zorro-antd/time-picker NzTimePickerComponent#nzBorderless
ng-zorro-antd/tooltip NzToolTipModule NzToolTipComponent

Unify and standardize component naming, involving the following name changes:

Module Original Current
core NzConfig#backTop NzConfig#floatButton
core NzConfig#dropDown NzConfig#dropdown
dropdown NzDropDownModule NzDropdownModule
dropdown NzDropDownADirective NzDropdownADirective
menu NzIsMenuInsideDropDownToken NzIsMenuInsideDropdownToken
watermark NzWaterMarkModule NzWatermarkModule
watermark NzWaterMarkComponent NzWatermarkComponent

Deprecations

The following APIs are marked as deprecated in v20 and will be removed in the next major version.
Please refer to related documentation for better alternatives.

Module API
ng-zorro-antd/collapse nz-collapse-panel[nzDisabled]
ng-zorro-antd/input textarea[nzAutosize], nz-input-group, [nz-input-group-slot]
ng-zorro-antd/upload nz-upload[nzTransformFile], NzUploadTransformFileType

21.0.0

2026-01-09

Code Refactoring

  • 迁移至 native animation API,您可以按需移除依赖 @angular/animations

Features

  • color-picker: 新增 nzPresets 参数支持预设颜色 (#9341) (d59ec99)
  • core: 新增 provideNzNoAnimation provider 用于禁用动画效果 (#9555) (c945e81)
  • date-picker: 日期范围选择顺序颠倒时确保能输出正确的范围 (#9518) (d0b3185)
  • float-button: 悬浮按钮组合新增动画效果 (#9413) (b40ad91)
  • input-number: 支持鼠标滚轮控制 (#9591) (6ce3545)
  • input,input-number: focus 方法新增额外参数 (#9595) (c336711)
  • qrcode: 新增 nzTypenzBoostLevel 参数,nzPadding 类型从 number | number[] 调整为 number (#9535) (5419b51)
  • tree-view: 升级 tree-view 组件,支持 nzLevelAccessornzChildrenAccessor (#9003) (ae9ad57)
  • upload: 新增 nzMaxCount 属性 (#9424) (0bf13c3)

Bug Fixes

  • i18n: 更新 fa_IR 国际化文案 (#9615) (1e8845d)
  • popconfirm: 允许设置 nzIconnull 以隐藏图标 (#9569) (760b587)
  • select: 单选模式下 nzAutoClearSearchValue 不应生效 (#9605) (4720c21)
  • tree: 不再阻止右键点击树节点标题的默认行为 (#9532) (900efad)

⚠ BREAKING CHANGES

  • back-top: 移除,请使用 float-button 替代
  • color-picker: 简化 DOM 结构,移除 nzClick output 不必要的参数
  • input-number-legacy: 移除,请使用 input-number 替代
  • qrcode: nzPadding 类型从 number | number[] 调整为 number
  • statistic: 重命名 NzStatisticNumberComponentNzStatisticContentValueComponent
  • tabs: 移除已弃用的 nz-tabset selector
  • tree-view: 移除 nzTreeControl,请使用 nzLevelAccessornzChildrenAccessor 替代
  • watermark: 将引入路径 ng-zorro-antd/water-mark 调整为 ng-zorro-antd/watermark

移除以下在过去的版本中标记为废弃的 API:

Module API
ng-zorro-antd/back-top *
ng-zorro-antd/input-number-legacy *
ng-zorro-antd/dropdown NzDropdownButtonDirective
ng-zorro-antd/core NzHighlightModule
ng-zorro-antd/auto-complete NZ_AUTOCOMPLETE_VALUE_ACCESSOR
ng-zorro-antd/checkbox nz-checkbox-wrapper
ng-zorro-antd/date-picker NzDatePickerComponent#nzBorderless
ng-zorro-antd/input NzInputDirective#nzBorderless
ng-zorro-antd/input-number NzInputNumberComponent#nzBordered
ng-zorro-antd/mention NZ_MENTION_TRIGGER_ACCESSOR
ng-zorro-antd/select NzSelectComponent#nzBorderless
ng-zorro-antd/time-picker NzTimePickerComponent#nzBorderless
ng-zorro-antd/tooltip NzToolTipModule NzToolTipComponent

统一组件命名规范,变化如下:

Module Original Current
core NzConfig#backTop NzConfig#floatButton
core NzConfig#dropDown NzConfig#dropdown
dropdown NzDropDownModule NzDropdownModule
dropdown NzDropDownADirective NzDropdownADirective
menu NzIsMenuInsideDropDownToken NzIsMenuInsideDropdownToken
watermark NzWaterMarkModule NzWatermarkModule
watermark NzWaterMarkComponent NzWatermarkComponent

Deprecations

在 v21 中,以下 API 被标记为 deprecated,并将在下一个主要版本中移除。 请参考相关文档以获取更好的替代方案。

Module API
ng-zorro-antd/collapse nz-collapse-panel[nzDisabled]
ng-zorro-antd/input textarea[nzAutosize], nz-input-group, [nz-input-group-slot]
ng-zorro-antd/upload nz-upload[nzTransformFile], NzUploadTransformFileType

Don't miss a new ng-zorro-antd release

NewReleases is sending notifications on new releases.