---
Title: Schematics
URL: https://ng.ant.design/docs/schematics/en
---
Using a CLI helps initialize projects, generate template codes and reduce development time.
> The`ng-zorro-antd` scaffolding is essentially based on [schematics](https://blog.angular.dev/schematics-an-introduction-dc1dfbc2a2b2).
## Initialize A Project
Initialize a project with `ng-zorro-antd`.
Run the command `ng add ng-zorro-antd` under your project directory, and follow the options to configure settings including whether you want to import i18n files and stylesheets, and load initial modules.
In the meantime, you can choose an existing project template while creating your project, and then develop the project on the basis of it.
### Command
```bash
ng add ng-zorro-antd [options]
```
## Component Generation
There are template source codes under every component API show case, you may obtain these codes by expanding `Show Code`.
### Command
```bash
ng g ng-zorro-antd:[schematic] [options]
```
For example, you can generate a login form with the follow command.
```bash
ng g ng-zorro-antd:form-normal-login login
```
---
Title: Ant Design of Angular
URL: https://ng.ant.design/docs/introduce/en
---
An enterprise-class Angular UI component library based on Ant Design, all components are open source and free to use under MIT license.
+
## Features
- An enterprise-class UI design language for Angular applications.
- 70+ high-quality Angular components out of the box.
- Written in TypeScript with complete defined types.
- Support OnPush mode, high performance.
- Powerful theme customization in every detail.
- Internationalization support for dozens of languages.
## Environment Support
- Modern browsers, [Browser support](https://angular.dev/reference/versions#browser-support)
- Server-side Rendering
- [Electron](https://www.electronjs.org/)
| [](https://godban.github.io/browsers-support-badges//) Edge | [](https://godban.github.io/browsers-support-badges/) Firefox | [](https://godban.github.io/browsers-support-badges/) Chrome | [](https://godban.github.io/browsers-support-badges/) Safari | [](https://godban.github.io/browsers-support-badges/) Opera | [](https://godban.github.io/browsers-support-badges/) Electron |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| last 2 versions | last 2 versions | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
## Version
[](https://www.npmjs.org/package/ng-zorro-antd)
## Angular Support
`ng-zorro-antd` keeps the same major version with `@angular/core`, now supports Angular `^20.0.0`.
## Design Specification
`ng-zorro-antd` synchronizes design specification with [Ant Design](https://ant.design/docs/spec/introduce) on a regular basis, you can check the [log](https://github.com/NG-ZORRO/ng-zorro-antd/actions?query=workflow:"styles-sync") online.
## Installation
**We recommend using `@angular/cli` to install**,it not only makes development easier,but also allow you to take advantage of the rich ecosystem of angular packages and tooling.
```bash
$ ng new PROJECT_NAME
$ cd PROJECT_NAME
$ ng add ng-zorro-antd
```
> More information about `@angular/cli` [here](https://github.com/angular/angular-cli).
You can also install `ng-zorro-antd` with npm or yarn
```bash
$ npm install ng-zorro-antd
```
## Companies using ng-zorro-antd
- [Alibaba](https://www.alibaba.com/)
- [Aliyun](https://www.aliyun.com/)
- [ThoughtWorks](https://www.thoughtworks.com/)
- [China Merchants Bank](https://english.cmbchina.com/)
- [Ververica](https://www.ververica.com/)
- [Apache Flink](https://flink.apache.org/)
- [Apache Zeppelin](https://zeppelin.apache.org/)
- [Apache Submarine](https://submarine.apache.org/)
- [Apache Metron](https://metron.apache.org/)
- [Process Automation Group](https://pag.company/)
- [AISINOCO](https://www.aisino.com/)
- [GongDao](https://www.gongdao.com/)
- [UC Express](https://www.uce.cn/)
- [Qingflow](https://qingflow.com/)
- [DataGrand](https://datagrand.com/)
- [ScentBird](https://www.scentbird.com/)
- [Southern Institute of Technology](https://www.sit.ac.nz/)
- [Hapify (Dynamic boilerplates tool)](https://hub.hapify.io/)
> We list some users here, if your company or product uses ng-zorro-antd, let us know [here](https://github.com/NG-ZORRO/ng-zorro-antd/issues/1142)!
## Contributing
Please read our [CONTRIBUTING.md](https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/CONTRIBUTING.md) first.
If you'd like to help us improve ng-zorro-antd, just create a [Pull Request](https://github.com/NG-ZORRO/ng-zorro-antd/pulls). Feel free to report bugs and issues [here](https://ng.ant.design/issue-helper/#/en).
> If you're new to posting issues, we ask that you read [*How To Ask Questions The Smart Way*](https://www.catb.org/~esr/faqs/smart-questions.html)(This guide does not provide actual support services for this project!) and [How to Ask a Question in Open Source Community](https://github.com/seajs/seajs/issues/545) and [How to Report Bugs Effectively](https://www.chiark.greenend.org.uk/~sgtatham/bugs.html) prior to posting. Well written bug reports help us help you!
## Need Help?
For questions on how to use ng-zorro-antd, please post questions to [](https://stackoverflow.com/questions/tagged/ng-zorro-antd) using the `ng-zorro-antd` tag. If you're not finding what you need on stackoverflow, you can find us on [Discussions · NG-ZORRO/ng-zorro-antd](https://github.com/NG-ZORRO/ng-zorro-antd/discussions) as well.
As always, we encourage experienced users to help those who are not familiar with `ng-zorro-antd`!
---
Title: Internationalization
URL: https://ng.ant.design/docs/i18n/en
---
The default language of `ng-zorro-antd` is Chinese yet.
If you want to use other languages, you can follow the instructions below.
You can also set the language with `ng add ng-zorro-antd` when creating project.
## Default i18n Language
`ng-zorro-antd` provides several configuration tokens for global configuration of international copy and date,
`NZ_I18N` for the international copy, and `NZ_DATE_CONFIG` for date-related features. In addition, we use Angular's
language pack for date formatting by default (need to introduce the corresponding Angular language pack).
In addition, we also provide an optional `NZ_DATE_LOCALE` for date-fns mode to format local dates (depending on the [`date-fns`](https://date-fns.org/docs/I18n) library,
see `How to use date-fns for date formatting`) below.
```ts
/** config angular i18n **/
import { registerLocaleData } from '@angular/common';
import en from '@angular/common/locales/en';
registerLocaleData(en);
/** config ng-zorro-antd i18n **/
import { provideNzI18n, en_US } from 'ng-zorro-antd/i18n';
/** set the default i18n config **/
export const appConfig: ApplicationConfig = {
providers: [
// ...
provideNzI18n(en_US)
]
}
```
## Work with Angular localize
When using [@angular/localize](https://angular.dev/guide/i18n/add-package), ng-zorro-antd could keep the same localization with angular via [LOCALE_ID](https://angular.dev/api/core/LOCALE_ID)
```ts
/** import all locales data **/
import { LOCALE_ID } from '@angular/core';
import { registerLocaleData } from '@angular/common';
import en from '@angular/common/locales/en';
import zh from '@angular/common/locales/zh';
registerLocaleData(en);
registerLocaleData(zh);
/** config ng-zorro-antd i18n **/
import { en_US, NZ_I18N, fr_FR } from 'ng-zorro-antd/i18n';
/** switch ng-zorro-antd locales via LOCALE_ID **/
export const appConfig: ApplicationConfig = {
providers: [{
provide: NZ_I18N,
useFactory: () => {
const localId = inject(LOCALE_ID);
switch (localId) {
case 'en':
return en_US;
/** keep the same with angular.json/i18n/locales configuration **/
case 'fr':
return fr_FR;
default:
return en_US;
}
}
}]
}
```
## Service
`ng-zorro-antd` provides the service of `NzI18nService` to dynamic change the locale text.
```ts
import { en_US, NzI18nService } from 'ng-zorro-antd/i18n';
class DemoComponent {
private i18n = inject(NzI18nService);
switchLanguage() {
this.i18n.setLocale(en_US);
}
}
```
Note: `en_US` is the package name, follow below.
Supported languages:
| Package Name | Language |
|--------------|-----------------------|
| ar_EG | Arabic |
| az_AZ | Azerbaijani |
| bg_BG | Bulgarian |
| bn_BD | Bangla (Bangladesh) |
| by_BY | Belarusian |
| ca_ES | Catalan |
| cs_CZ | Czech |
| da_DK | Danish |
| de_DE | German |
| el_GR | Greek |
| en_AU | English (Australia) |
| en_GB | English |
| en_US | English (America) |
| es_ES | Spanish |
| et_EE | Estonian |
| fa_IR | Persian |
| fi_FI | Finnish |
| fr_BE | French (Belgium) |
| fr_CA | French (Canada) |
| fr_FR | French (France) |
| ga_IE | Irish Gaelic |
| gl_ES | Galician (Spain) |
| he_IL | Hebrew |
| hi_IN | Hindi |
| hr_HR | Croatian |
| hu_HU | Hungarian |
| hy_AM | Armenian |
| id_ID | Indonesian |
| is_IS | Icelandic |
| it_IT | Italian |
| ja_JP | Japanese |
| ka_GE | Georgian |
| kk_KZ | Kazakh |
| km_KH | Khmer |
| kmr_IQ | Kurmanji |
| kn_IN | Kannada |
| ko_KR | Korean |
| ku_IQ | Kurdish |
| lt_LT | Lithuanian |
| lv_LV | Latvian |
| mk_MK | Macedonian |
| ml_IN | Malayalam (India) |
| mn_MN | Mongolian |
| ms_MY | Malay |
| nb_NO | Norwegian |
| ne_NP | Nepali |
| nl_BE | Dutch (Belgium) |
| nl_NL | Dutch |
| pl_PL | Polish |
| pt_BR | Portuguese (Brazil) |
| pt_PT | Portuguese |
| ro_RO | Romanian |
| ru_RU | Russian |
| sk_SK | Slovak |
| sl_SI | Slovenian |
| sr_RS | Serbian |
| sv_SE | Swedish |
| ta_IN | Tamil |
| th_TH | Thai |
| tr_TR | Turkish |
| uk_UA | Ukrainian |
| ur_PK | Urdu (Pakistan) |
| vi_VN | Vietnamese |
| zh_CN | Chinese (Simplified) |
| zh_HK | Chinese (Traditional) |
| zh_TW | Chinese (Traditional) |
## How to format a date using date-fns
For date formatting, we use Angular's DatePipe ([syntax reference](https://angular.dev/api/common/DatePipe) to implement (depending on Angular's locale language pack),
but due to Angular's own DatePipe is not implemented according to the ISO standard algorithm ([issue #25380](https://github.com/angular/angular/issues/25380)),
the week number may not match expectations (related issues: [#2406]( https://github.com/NG-ZORRO/ng-zorro-antd/issues/2406), [#2819](https://github.com/NG-ZORRO/ng-zorro-antd/issues/2819) ).
So we have a new `date-fns` method ([syntax reference](https://date-fns.org/docs/format#description)) for standard date formatting, you can switch to it by the following way
(after switching, it will affect the date formatting of all date related components such as Calendar/DatePicker):
```ts
// Set the value of NZ_DATE_LOCALE in the `app.config.ts` to activate date-fns mode
import { enUS, ja } from 'date-fns/locale';
export const appConfig: ApplicationConfig = {
providers: [
{ provide: NZ_DATE_LOCALE, useValue: enUS }
]
}
// Switch language to Japanese at runtime
import { NzI18nService } from 'ng-zorro-antd/i18n';
export class AppComponent{
private i18n = inject(NzI18nService);
switchLanguage() {
this.i18n.setDateLocale(ja);
}
}
```
After the switch is successful, you can also choose to remove the dependency on the Angular Locales package (remove the code below) to reduce the package size:
```ts
// The following code can be removed as needed
import { registerLocaleData } from '@angular/common';
import en from '@angular/common/locales/en';
registerLocaleData(en);
```
### NZ_DATE_CONFIG (Date global configuration)
The default configuration is as follows:
```ts
{
/** Specify which day is the beginning of the week (null for default, 0 for Sunday, 1 for Monday, and so on) */
firstDayOfWeek: null
}
```
## Language supported by date-fns
[https://date-fns.org/docs/I18n#supported-languages](https://date-fns.org/docs/I18n#supported-languages)
## How to override internationalization configuration
The text of some components in `ng-zorro` depends on the internationalized text, such as the `size changer` in `nz-pagination`. At this time, you can modify the internationalization configuration to change the text content in the `size changer`:
```ts
import { en_US, provideNzI18n } from 'ng-zorro-antd/i18n';
const customLanguagePack = {
en_US,
...{
Pagination: {
items_per_page: "per page"
}
}
}
export const appConfig: ApplicationConfig = {
providers: [
provideNzI18n(customLanguagePack)
]
}
```
---
Title: Global Configuration
URL: https://ng.ant.design/docs/global-config/en
---
We add a **global configuration** support to many components. You can define the default behavior of these components through the global configuration, which reduces redundant codes that must be written in the templates (makes your codes concise). Moreover, it supports altering the global configuration at runtime.
## How to Use?
In order to provide default configurations in certain components, please use `provideNzConfig` function. object providing implements interface `NzConfig`For example:
```typescript
import { NzConfig, provideNzConfig } from 'ng-zorro-antd/core/config';
const ngZorroConfig: NzConfig = {
message: { nzTop: 120 },
notification: { nzTop: 240 }
};
export const appConfig: ApplicationConfig = {
providers: [
provideNzConfig(ngZorroConfig)
]
}
```
These global configurations would be injected and stored in a service named `NzConfigService`.
### Provide Template Instances
Some components accept `TemplateRef` as a default parameter.
One of the easiest approaches is to invoke relevant functions from `NzConfigService` in the root component.
```typescript
import { NzConfigService } from 'ng-zorro-antd/core/config';
export class AppComponent implements OnInit {
private nzConfigService = inject(NzConfigService);
@ViewChild('nzIndicatorTpl', { static: true })
nzIndicator!: TemplateRef;
ngOnInit(): void {
this.nzConfigService.set('spin', { nzIndicator: this.nzIndicator });
}
}
```
However, this violates the separation of concerns principle and causes codes to be bloated in the `AppComponent`.
To solve this, it is recommended to use a `FactoryProvider` instead of a `ValueProvider` (shown above) at the `NgModule` level.
```typescript
// The module-level Component which contains template references.
// Exporting is required for AOT compatibility
@Component({
template: `
`
})
export class GlobalTemplatesComponent {
@ViewChild('nzIndicatorTpl', { static: true })
nzIndicator!: TemplateRef;
}
// The Factory function
const nzConfigFactory = (): NzConfig => {
const environmentInjector = inject(EnvironmentInjector);
const { nzIndicator } = createComponent(component, { environmentInjector }).instance;
return {
spin: {
nzIndicator
}
};
};
export const appConfig: ApplicationConfig = {
providers: [
{ // The FactoryProvider
provide: NZ_CONFIG,
useFactory: nzConfigFactory
}
]
}
```
## Overwrite inside Component
Developers can use Dependency Injection to reset `NZ_CONFIG` within a particular component, which will not affect configurations outside it.
```typescript
@Component({
providers: [
// reset local NzConfigService
NzConfigService,
{
provide: NZ_CONFIG,
useValue: {
button: {
nzSize: 'large'
}
}
}
]
})
```
You can also use `useFactory` to combine the global configuration with the local configuration to take effect
> Note: Change global configuration after component initialization won't affect local configuration
```typescript
@Component({
providers: [
// reset local NzConfigService
NzConfigService,
{
provide: NZ_CONFIG,
useFactory: () => {
// get global NzConfigService
const globalConfig = inject(NzConfigService, { skipSelf: true }).getConfig();
const localConfig = {
select: {
nzBorderless: true
}
};
// merge local and global config
const mergedConfig = {
...globalConfig,
...localConfig
};
return mergedConfig;
},
}
]
})
```
## Dynamically Change Configurations
You can alter the global configuration of a specific component through the `set` method of `NzConfigService`. For example:
```typescript
import { NzConfigService } from 'ng-zorro-antd/core/config';
@Component({})
export class ChangeZorroConfigComponent {
private nzConfigService = inject(NzConfigService);
onChangeConfig() {
this.nzConfigService.set('button', { nzSize: 'large' })
}
}
```
All component instances is responsive to this configuration change (as long as they are not configured independently).
## Priority of Global Configurations
For any property that supports global configuration, the sequence of priority is based on following:
**Parameters passed to a component instance (in templates or through methods like `service.create` > global configuration provided by the injection token `NZ_CONFIG` > default value in ng-zorro-antd**
For example, if you want to create a `NzNotification` component:
1. When you call `NzNotificationService.success`, you pass `{ nzDuration: 6000 }` as the third parameter
2. You provide `{ notification: { nzDuration: 5000 } }` through the injection token `NZ_CONFIG`
3. `ng-zorro-antd` has a default value of 4500
Consequently, this particular notification will be visible for 6000 milliseconds.
## Check all Available Globally Configurable Parameters
The interface `NzConfig` provide complete information about all components and parameters that are globally configurable. You can also check each individual component's API for more details.
---
Title: Getting Started
URL: https://ng.ant.design/docs/getting-started/en
---
Ant Design of Angular is dedicated to providing a **good development experience** for programmers.
> The prerequisite of Ant Design Angular is a solid background knowledge of [Angular](https://angular.dev) and [JavaScript ES2015](http://babeljs.io/docs/learn-es2015/).
## Playground
The following StackBlitz link demonstrates a basic use case, and it is recommended to fork this demo as a baseline while doing `Bug Report`. However, please do not use this demo as a scaffold in a real production environment.
- [NG-ZORRO StackBlitz](https://stackblitz.com/edit/ng-zorro-antd-ivy)
## First Local Development
There are several engineering requirements during development, including compiling, debugging, proxying, and packaging codes in TypeScript. We strongly encourage you to develop your project with the help of Angular official CLI `@angular/cli`. To be concise, a simple example is demonstrated below.
### Installation
> Read the documentation of [Angular](https://angular.dev/cli) to explore more features.
```bash
$ npm install -g @angular/cli
# Or if you use yarn
$ yarn global add @angular/cli
```
### Create a New Project
The following command allows `@angular/cli` to create a folder called `PROJECT-NAME` under the current directory, with necessary dependencies.
```bash
$ ng new PROJECT-NAME
```
`@angular/cli` will run `npm install` or `yarn` after a project is created. You can run `npm install` or `yarn` by yourself if it fails.
### Install ng-zorro-antd
After changing the directory to the newly created project, you can automatically run the following commands to initialize the project's configuration, including importing i18n files and stylesheets and loading initial modules.
```bash
$ cd PROJECT-NAME
$ ng add ng-zorro-antd
```
`ng-zorro-antd` supports initializing configuration with schematics, more information is available in the [schematics](/docs/schematics/en) section.
### Development & Debugging
Your project is now ready to run. After running the following command, a welcome page will be displayed in your browser.
```bash
$ ng serve --port 0 --open
```
### Building & Deployment
```bash
$ ng build --prod
```
Project files are built and generated in the `dist` directory by default.
## Customized Build
You may use any existing scaffold tools in the Angular ecosystem in order to customize the building process. Please refer to [configure](https://github.com/NG-ZORRO/ng-zorro-antd/tree/master/integration) section if you encounter any issues.
### Install ng-zorro-antd
```bash
$ npm install ng-zorro-antd --save
# Or if you use yarn
$ yarn add ng-zorro-antd
```
### Import Styles
#### Use all component styles
This configuration contains all the styles of our components' library.
If you want to use only certain components' styles, please refer to [Use only certain component styles](/docs/getting-started/en#use-only-certain-component-styles) section.
Import the pre-built stylesheet in `angular.json`
```json
{
"styles": [
"node_modules/ng-zorro-antd/ng-zorro-antd.min.css"
]
}
```
Import the pre-built stylesheet in `style.css`
```css
@import "~ng-zorro-antd/ng-zorro-antd.min.css";
```
Import the less stylesheet in `style.less`
```less
@import "~ng-zorro-antd/ng-zorro-antd.less";
```
#### Use only certain component styles
> Please note that importing CSS files of several components may result in code redundancy due to the dependency relationships among some components' styles.
It is necessary to import base styles (common to all components) before using certain components' styles.
Import the pre-build styles in `style.css`
```css
@import "~ng-zorro-antd/style/index.min.css"; /* Import base styles */
@import "~ng-zorro-antd/button/style/index.min.css"; /* Import one component's styles */
```
Import the less styles in `style.less`
```less
@import "~ng-zorro-antd/style/entry.less"; /* Import base styles */
@import "~ng-zorro-antd/button/style/entry.less"; /* Import one component's styles */
```
#### Import component module
Finally, you need to import the component modules that you want to use into your components.
Taking the following `NzButtonModule` module as an example, first import the component module:
```ts
import { Component } from '@angular/core';
import { NzButtonModule } from 'ng-zorro-antd/button';
@Component({
imports: [
NzButtonModule
]
})
export class AppComponent {}
```
Then use the component inside the template:
```html
```
# Precautions
- `ng-zorro-antd` already contains `@angular/cdk/overlay-prebuilt.css` overlay style, no additional import is required.
## Other
- [I18n](/docs/i18n/en)
- [Customize Theme](/docs/customize-theme/en)
- [Use Icons](/components/icon/en)
---
Title: FAQ
URL: https://ng.ant.design/docs/faq/en
---
### The bundle size of Angular and `ng-zorro-antd`
The size hello-world project of angular after gzip is about `30KB`, the size of `ng-zorro-antd`'s doc site is about `287KB`.
If you meet the bundle size issue, please make sure you use `ng build --prod` correctly to compile. If other third-party component kits other than `ng-zorro-antd` are imported, you could generate a sourcemap file using this command `ng build --prod --sourceMap=true` to check every dependency's bundled size. You can check [this link](https://angular.io/guide/deployment#inspect-the-bundles) for further instructions.
### Runtime performance of Angular and `ng-zorro-antd`
Angular Vue and React have very similar benchmarks, which should not be a deciding factor, ref [benchmark](https://github.com/krausest/js-framework-benchmark)。All components of `ng-zorro-antd` are Angular Native and under `OnPush` mode, which will provide the best performance of Angular.
### Can I use ng-zorro-antd in other Angular version?
`ng-zorro-antd` keeps the same major version with `@angular/core`, for example `ng-zorro-antd@8` supports `@angular/core@8`. In order to get the best performance, we recommend to use the latest version of angular, ref [update docs](https://angular.dev/update-guide).
### Can I use only some of the components of ng-zorro-antd?
Yes, all components of `ng-zorro-antd` can be imported separately.
### Why ng-zorro-antd use less? Can I use sass instead?
ng-zorro-antd follow the design spec of Ant Design, which could customize theme by less. `@angular/cli` support using both `less` and `sass` in the same project, they could work together.
### Can I use ng-zorro-antd with d3, jquery?
All codes of ng-zorro-antd are native angular code, they won't have conflict with the other third libs.
### Can't Bind to since it isn't a known property of
Please make sure you have export NG-ZORRO's feature modules in `ShareModule` if you have more than one module in your angular project, [ref](https://angular.dev/guide/ngmodules/sharing).
### Expression Changed After It Has Been Checked Error
This [doc](https://blog.angularindepth.com/everything-you-need-to-know-about-the-expressionchangedafterithasbeencheckederror-error-e3fd9ce7dbb4) will help you.
### Can't bind to 'formGroup' since it isn't a known property of 'form'
Don't forget to import `ReactiveFormsModule`, [ref](https://angular.dev/guide/forms/reactive-forms).
### The difference between `[nzValue]="data"` `nzValue="data"` and `nzValue="{{data}}"`
`nzValue="data"` the component would get the `data` string, `nzValue="{{data}}"` equals to `[nzValue]="data.toString()"`. If you need pass `number` or `boolean` data, you should use `[nzValue]="data"`.
### Why my page content is not updated after I change the data?
In order to get better performance, all NG-ZORRO's components are running under [OnPush](https://angular.dev/guide/components/advanced-configuration#changedetectionstrategy) mode, this means any mutate to the `@Input()` data won't trigger change detection, please use immutable way to update array or object.
```typescript
// add data
this.dataSet = [ ...this.dataSet, {
key : `${this.i}`,
name : `Edward King ${this.i}`,
age : '32',
address: `London, Park Lane no. ${this.i}`
}];
// remove data
this.dataSet = this.dataSet.filter(d => d.key !== i);
```
Recommend using [immer](https://immerjs.github.io/immer/docs/introduction) for a better development experience.
### My Angular app is deadlock, what happened?
Evaluation of a template expression should have no visible side effects. It would cause performance issue or deadlock if you go against the rule. The following component will print `I will run every time` every time.
```typescript
@Component({
template: `
`
})
export class BugComponent {
value(): string {
console.log('I will run every time');
return 'value';
}
}
```
### How to make Angular applications faster?
Read [https://web.dev/angular](https://web.dev/angular).
### Why some features are not supported?
`ng-zorro-antd` is an implementation of Ant Design for Angular, which means only features supported by Ant Design would be implemented by `ng-zorro-antd`.
### Browser compatibility
Please make sure your browser is [supported by Angular](https://github.com/angular/angular) and you have imported the [polyfill](https://angular.dev/reference/versions#polyfills) file correctly. And some components' usages are not supported by some browsers (i.e `flex` property). Please submit an issue if none of these is your case.
### Why my issue is closed?
Issue is designed for maintainers and users to track the development process of the project, which means only bug reports and feature requests are accepted and usage questions are not. And to give priority to well-explained jobs, issues that are not written in the given format would be closed automatically by the bot right away.
### Where can I get help with Angular?
You can checkout the official docs and Angular forums. A good trick is to search on Google using `[keywords] -angularjs` to prevent `angularjs`'s interference. For example, you can type in `angular ngmodel -angularjs` to learn more about `ngModel` without struggling in out-dated Angular.js things.
---
Title: Direction
URL: https://ng.ant.design/docs/direction/en
---
Set the direction (LTR / RTL).
## Set the default direction
Set the `dir` attribute on the document `body` or `html` tag.
```html
```
## Set in the template
Import the Angular CDK bidi module.
```typescript
import { BidiModule } from '@angular/cdk/bidi';
```
Set the direction for the application or its descendants in the template.
```html
```
## Set in the service
For example, the modal service.
```typescript
class MyComponent {
constructor(private modalService: NzModalService, private configService: NzConfigService) { }
openModal(): void {
this.modal.create({
nzDirection: 'rtl'
})
}
setDirWithConfig(): void {
this.nzConfigService.set('modal', { nzDirection: 'rtl' });
}
}
```
### References
- [Angular CDK Bidirectionality](https://material.angular.io/cdk/bidi/api)
- [dir - HTML: HyperText Markup Language | MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir)
---
Title: Theme Customization
URL: https://ng.ant.design/docs/customize-theme/en
---
Ant Design allows you to customize some basic design aspects in order to meet the needs of UI diversity from business and brand, including primary color, border radius, border color, etc.

We are using [Less](https://lesscss.org/) as the development language for styling. A set of Less variables are defined for each design aspect that can be customized to your needs.
> You can use the theme define file of react version in ng-zorro-antd too.
## Use Pre-defined Themes
### Customize the theme
1. Configure with schematics. Run `ng add ng-zorro-antd`, choose not to set up custom theme file and your `angular.json` will be configured automatically:
```json
{
"build": {
"options": {
"styles": [
"./node_modules/ng-zorro-antd/ng-zorro-antd.min.css"
]
}
}
}
```
You can also add this config manually in `angular.json`.
### Official Themes
Besides the default theme, we have provided 3 more official themes. Please try them out and give us feedbacks.
- 🌑 Dark Theme
- 📦 Compact Theme
- ☁️ Aliyun Theme
#### Method 1: Less
Import `ng-zorro-antd.less`, `ng-zorro-antd.dark.less`, `ng-zorro-antd.compact.less` or `ng-zorro-antd.aliyun.less` in the style file and override style variables.
```less
// Import the official default less style file
@import "~ng-zorro-antd/ng-zorro-antd.less";
// Import the official dark less style file
//@import "~ng-zorro-antd/ng-zorro-antd.dark.less";
// Import the official compact less style file
//@import "~ng-zorro-antd/ng-zorro-antd.compact.less";
// Import the official Aliyun less style file
//@import "~ng-zorro-antd/ng-zorro-antd.aliyun.less";
```
#### Method 2: CSS
If the project does not use Less, you can include `ng-zorro-antd.css`, `ng-zorro-antd.dark.css`, `ng-zorro-antd.compact.css` or `ng-zorro-antd.aliyun.css` in the CSS file or add to the `angular.json` config.
CSS file:
```css
@import "~ng-zorro-antd/ng-zorro-antd.css";
/*@import "~ng-zorro-antd/ng-zorro-antd.dark.css";*/
/*@import "~ng-zorro-antd/ng-zorro-antd.compact.css";*/
/*@import "~ng-zorro-antd/ng-zorro-antd.aliyun.css";*/
```
In `angular.json`:
```json
{
"build": {
"options": {
"styles": [
"node_modules/ng-zorro-antd/ng-zorro-antd.css"
]
}
}
}
```
## Customize Pre-defined Theme
### Method 1: Override style variables in Less
#### Import pre-defined theme file
Import pre-defined theme file in the `src/styles.less` (or run `ng add ng-zorro-antd`, choose to set up custom theme automatically):
```less
// Custom Theming for NG-ZORRO
// For more information: https://ng.ant.design/docs/customize-theme/en
@import "../node_modules/ng-zorro-antd/ng-zorro-antd.less";
...
```
#### Customize style variables
After importing the theme file, override the values of theme style variables based on the project requirements. For example, the demo below illustrates how we can override the `ng-zorro-antd` default theme's `@primary-color` to `#f5222d`:
```less
// -------- import official less file -----------
@import "../node_modules/ng-zorro-antd/ng-zorro-antd.less";
// -------- override less variables -----------
@primary-color: #f5222d;
```
### Method 2: Override theme variables in webpack
#### Override by pre-defined theme variables
Using less-loader in webpack if needed:
```javascript
const darkThemeVars = require('ng-zorro-antd/dark-theme');
const compactThemeVars = require('ng-zorro-antd/compact-theme');
module.exports = {
module: {
rules: [
{
test : /\.less$/,
loader: 'less-loader',
options: {
modifyVars: {
'hack': `true;@import "${require.resolve('ng-zorro-antd/style/color/colorPalette.less')}";`,
...darkThemeVars,
...compactThemeVars
},
javascriptEnabled: true
}
}
]
}
};
```
#### Override by customized style variables
Angular CLI provide [custom-webpack-builder](https://www.npmjs.com/package/@angular-builders/custom-webpack), you can modify the less variable via adjusting the [less-loader](https://github.com/webpack-contrib/less-loader) options in webpack.
1. Import `ng-zorro-antd.less` in `angular.json`
```json
{
"styles": [
"node_modules/ng-zorro-antd/ng-zorro-antd.less"
]
}
```
2. Install `@angular-builders/custom-webpack` builder
```bash
npm i -D @angular-builders/custom-webpack
```
3. create `extra-webpack.config.js`
```javascript
module.exports = {
module: {
rules: [
{
test : /\.less$/,
loader: 'less-loader',
options: {
modifyVars: { // modify theme variable
'primary-color': '#1DA57A',
'link-color': '#1DA57A',
'border-radius-base': '2px'
},
javascriptEnabled: true
}
}
]
}
};
```
4. Customize builder in `angular.json`
```diff
"architect": {
"build": {
- "builder": "@angular-devkit/build-angular:browser",
+ "builder": "@angular-builders/custom-webpack:browser",
"options": {
+ "customWebpackConfig": {
+ "path": "./extra-webpack.config.js",
+ "mergeStrategies": {
+ "module.rules": "append"
+ },
+ "replaceDuplicatePlugins": true
+ }
},
},
"serve": {
- "builder": "@angular-devkit/build-angular:dev-server",
+ "builder": "@angular-builders/custom-webpack:dev-server",
}
}
```
You can get more information about custom-webpack builder following the articles
* [Angular Builder Document](https://www.npmjs.com/package/@angular-builders/custom-webpack)
* [Angular CLI: Custom webpack Config](https://alligator.io/angular/custom-webpack-config/)
* [Customize Webpack Configuration in Your Angular Application](https://netbasal.com/customize-webpack-configuration-in-your-angular-application-d09683f6bd22)
All less variables can be viewed [here](https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/components/style/themes/default.less) is a sample of theme define file.
## Theme Dynamic Switching
We have prepared you a demonstration project illustrating how theme dynamic switching works, you can check it out [here](https://github.com/yangjunhan/nz-themes).
### Configure angular.json file
1. Style preprocessor option `stylePreprocessorOptions`
Add path in a style preprocessor option called `stylePreprocessorOptions` in `angular.json`:
```json
"stylePreprocessorOptions": {
"includePaths": [
"src/path-to-mixin"
]
},
```
As such, this config allows you to import `.themeMixin(@rules)` definition file which is under `src/path-to-mixin` path anywhere in the project without the need of using relative path:
```css
// A relative path works
@import 'src/path-to-mixin/mixin';
// But now this works as well
@import 'mixin';
```
2. `bundleName` and `inject` in styles
If you intend to dynamically switch the pre-defined themes at runtime, you would need to configure every theme's bundling strategy for the bundler. For example, if your app has default and dark themes, the `styles` option of `angular.json` needs to be configured as below:
```json
"styles": [
"src/styles.less",
{
"input": "src/styles/default.less",
"bundleName": "default",
"inject": false
},
{
"input": "src/styles/dark.less",
"bundleName": "dark",
"inject": false
}
],
```
`bundleName` refers to the CSS bundle filename which is used for the href attribute in link tag for switching the pre-defined themes in the later section. `inject`'s default value is `true`, which the bundle is injected by default. For the purpose of theme dynamic switching, you need to set it to false to exclude the bundle from injection.
### Customize theme stylesheets
In the context of multiple themes, every theme is supposed to have its own style entry file. For better project manageability, we also recommend you to put all relevant theme entry files under `src/styles` path. For a project with default and dark themes, your project styles can be in the following structure:
Stylesheets under `src/styles/` are entry files which are used to import the pre-defined official entry file as well as theme customization stylesheets under `src/styles/themes/`. For example, `src/styles/dark.less` entry file contains the following lines:
```less
@import '../../node_modules/ng-zorro-antd/ng-zorro-antd';
@import "./themes/dark";
```
Accordingly, `src/styles/themes/dark.less` is in charge of customizing dark theme:
```less
@import (multiple) '../../../node_modules/ng-zorro-antd/src/style/themes/dark';
@import './base';
@layout-sider-background: @component-background;
@layout-header-background: @component-background;
```
> The theme filename that you define can be identical to corresponding pre-defined theme filename. In such cases, `@import '';` has no effects. Less provides us a solution to this circumstance which uses `multiple` method to import `.less` files with identical filenames, i.e. `@import (multiple) '';`.
Note that if there exists common style variables for all themes, you should create a `base.less` stylesheet and import it in every theme customization stylesheet:
```less
// base.less customizes common style variables
@margin-md: 17px;
...
```
### Switch themes
Switching themes involves two parts. First is switching the project component theme, and the other is switching the pre-defined theme.
#### Switching component theme
The default encapsulation policy of Angular for the template and CSS styles is `ViewEncapsulation.Emulated`, also known as shimmed CSS that emulates the native behavior. Based on different encapsulation policy, Angular will package component styles into a JS file in different ways.
However, it is troublesome to define styles in the following format:
```less
html {
&.default {
@import 'default';
// Component styles
...
}
&.dark {
@import 'dark';
// Component styles
...
}
}
```
> Be noted that the configured path in the style preprocessor option `stylePreprocessorOptions` allows you to import file without the need of relative path.
A better way to achieve this is to define a Mixin called `.themeMixin(@rules)` in the `mixin.less` file mentioned above:
```less
.themeMixin(@rules) {
html {
&.default {
@import './default.less';
@rules();
}
&.dark {
@import './dark.less';
@rules();
}
}
}
```
Then, wrap all the component styles in the `.themeMixin(@rules)`:
```less
@import "mixin"; // Similarly, no need for relative path
.themeMixin({
:host {
// Component styles
...
}
});
```
#### Switch pre-defined theme
Loading a pre-defined theme file can be achieved by dynamically creating a `link` tag, append it on the DOM and remove previous tag.
```ts
private loadCss(href: string, id: string): Promise {
return new Promise((resolve, reject) => {
const style = document.createElement('link');
style.rel = 'stylesheet';
style.href = href;
style.id = id;
style.onload = resolve;
style.onerror = reject;
document.head.append(style);
});
}
```
`href` here refers to the path of the [bundle name](/docs/customize-theme/zh#Configure-angular-json-file), i.e. `bundleName`.
#### Synchronize the style switching
Project component styles will be packaged into a JS file which take effects immediately while switching themes via html `className`. On the other hand, it takes time to dynamically load the CSS theme file. If you attempt to perform two actions simultaneously, project styles will change immediately whereas styles of the pre-defined theme remain unchanged until the CSS theme file is fully loaded, resulting two themes mixing on the web page. As such, you must wrap the loading CSS process in a Promise and force the `className` switching to wait until the former completely finishes.
```ts
private removeUnusedTheme(theme: ThemeType): void {
document.documentElement.classList.remove(theme);
const removedThemeStyle = document.getElementById(theme);
if (removedThemeStyle) {
document.head.removeChild(removedThemeStyle);
}
}
loadTheme(firstLoad = true): Promise {
const theme = this.currentTheme;
if (firstLoad) {
document.documentElement.classList.add(theme);
}
this.loadCss(`${theme}.css`, theme).then(
e => {
if (!firstLoad) {
document.documentElement.classList.add(theme);
}
this.removeUnusedTheme(this.previousTheme);
resolve(e);
},
e => reject(e)
);
}
```
Note: First-time loading of the user-defined default component theme must be performed immediately or there is a short period of time the app has no class of theme.
---
Title: Dynamic Theme (Experimental)
URL: https://ng.ant.design/docs/customize-theme-variable/en
---
Except [less customize theme](/docs/customize-theme/en), We also provide CSS Variable version to enable dynamic theme.
## Caveats
- This function depends on CSS Variables. Please check the [browser compatibility](https://caniuse.com/css-variables).
- This function requires at least `ng-zorro-antd@13.2.x`.
## How to use
### Import antd.variable.min.css
Replace your import style file with CSS Variable version:
```diff
- @import "~ng-zorro-antd/ng-zorro-antd.min.css";
+ @import "~ng-zorro-antd/ng-zorro-antd.variable.min.css";
```
Note: You need remove `babel-plugin-import` for the dynamic theme.
### Static config
In order to provide default configurations in certain components, please pass an object that implements the interface `NzConfig` through the injection token `NZ_CONFIG` in the root injector. For example:
```typescript
import { NzConfig, provideNzConfig } from 'ng-zorro-antd/core/config';
const ngZorroConfig: NzConfig = {
theme: {
primaryColor: '#1890ff'
}
};
export const appConfig: ApplicationConfig = {
providers: [
provideNzConfig(ngZorroConfig)
]
}
```
These global configurations would be injected and stored in a service named `NzConfigService`.
### Dynamically Change Configurations
You can alter the global configuration of CSS Variable through the `set` method of `NzConfigService`. For example:
```typescript
import { NzConfigService } from 'ng-zorro-antd/core/config';
@Component({
selector: 'app-change-zorro-config'
})
export class ChangeZorroConfigComponent {
private nzConfigService = inject(NzConfigService);
onChangeConfig() {
this.nzConfigService.set('theme', { primaryColor: '#1890ff' })
}
}
```
All component instances is responsive to this configuration change (as long as they are not configured independently).
## Conflict resolve
CSS Variable use `--ant` prefix by default. When exist multiple antd style file in your project, you can modify prefix to fix it.
### Compile less
Since prefix modified. Origin `antd.variable.css` should also be replaced:
```bash
lessc --js --modify-var="ant-prefix=custom" antd/dist/antd.variable.less modified.css
```
### Related changes
In order to implement CSS Variable and maintain original usage compatibility, we added `@root-entry-name: xxx;` entry injection to the `ng-zorro-antd.xxx.less` file to support less dynamic loading of the corresponding less file. Under normal circumstances, you do not need to pay attention to this change.
---
Title: How to Contribute
URL: https://ng.ant.design/docs/contributing/en
---
The following is a set of guidelines about making contributions to NG-ZORRO. Please spend several minutes in reading these guidelines before submitting an issue or pull request.
## Code of Conduct
We have adopted a [Code of Conduct](https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/CODE_OF_CONDUCT.md) that we expect every contributor to adhere to. Please look through each section carefully so that you can understand what actions will and will not be allowed.
## Open Development
All work on NG-ZORRO happens directly on [GitHub](https://github.com/NG-ZORRO/ng-zorro-antd). Both core team members and external contributors go through the same reviewing process in order to submit a pull request.
## Bugs
We are using [GitHub Issues](https://github.com/NG-ZORRO/ng-zorro-antd/issues) for bug tracing. The best way to get your bug fixed is using our [issue helper](https://ng.ant.design/issue-helper/#/en) and provide a reproduction following this [template](https://stackblitz.com/edit/ng-zorro-antd-ivy).
Before reporting a new bug, please make sure you have filtered existing issues, and read our [FAQ](docs/faq/en).
## Propose a Change
If you intend to change a public API or introduce a new feature, we also recommend you to use our [issue helper](https://ng.ant.design/issue-helper/#/en) to submit a feature request issue.
## Your First Pull Request
Please use the following resources for your first pull request:
* [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
* [First Contributions](https://github.com/firstcontributions/first-contributions)
To help you get your feet wet and get familiar with our contribution process, we have a list of [Good First Issue](https://github.com/NG-ZORRO/ng-zorro-antd/labels/good%20first%20issue) that contain either bugs that are relatively easy to be fixed or small features. These issues are considered as great starting points.
If you decide to handle an issue, please be sure to check the comment thread in case someone else has already been working on it. If nobody is working on it at the moment, please leave a comment stating that you intend to work on it, preventing others from doing duplicate work.
If somebody claimed an issue without any follow up for more than two weeks, it should be fine to take over it. Nevertheless, be sure to leave a comment under such issues.
## Contribute
The core team is monitoring all pull requests. Your pull request will be either successfully merged, requested for a change, or closed with a reasonable explanation.
**Before submitting a pull request**, please make sure to follow the steps below:
1. Run `npm install` in the repository root.
2. If you have fixed a bug or added a feature that should be tested, please add test cases!
3. Make sure the test suite passes (`npm run test`).
4. Make sure your code lints (`npm run lint`).
5. Make sure rebase your code to keep the history clean.
6. Make sure your commit message meet the requirements of [guidelines](https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/CONTRIBUTING.md#-commit-message-guidelines)
## How to Submit a Pull Request
1. Fork the repository of `ng-zorro-antd`. The later steps must be done on the forked repository
2. On `master`: `git remote add upstream https://github.com/NG-ZORRO/ng-zorro-antd.git`
3. On `master`: `git pull upstream master`
4. On `master`: `git push origin master`
5. Checkout to the feature branch (for example, if the branch is called `docs-fix`): `git checkout docs-fix`
6. On `docs-fix` rebase on master: `git rebase origin/master`
7. On `docs-fix` resolve codes and commit: `git commit -a`, you need to follow the [commit message guidelines](https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/CONTRIBUTING.md#-commit-message-guidelines)
8. Then, push up: `git push` (might need `-f`, just be sure you understand force pushing before you do it)
9. Submit a Pull Request on the Github
## Development Workflow
After cloning `ng-zorro-antd` and running `npm install` to install its dependencies, you can also run the following commands:
* `npm start` runs NG-ZORRO website locally.
* `npm run lint` checks the code style.
* `npm test` runs the complete test suite.
* `npm run test:watch [name]` run some test files and monitor changes.
* `npm run build:lib` creates a build of `ng-zorro-antd` under `publish` directory.
If you encounter problems while developing `ng-zorro-antd`, please refer to our [development guide](https://github.com/NG-ZORRO/ng-zorro-antd/wiki/Development-Guide) on the GitHub.
---
Title: Animations Switch
URL: https://ng.ant.design/docs/animations/en
---
NG-ZORRO allows developers to turn off the animations. You can set animations' switch by adding corresponding directives or
configurations, or use the global configuration to turn off all animations associated with it.
### Turn Off Globally
Replace `BrowserAnimationsModule` with `NoopAnimationsModule` in the module.
```ts
import { provideNoopAnimations } from '@angular/platform-browser/animations';
export const appConfig: ApplicationConfig = {
providers: [
// ...
provideNoopAnimations()
]
}
```
### Turn Off In Templates
Import `NzNoAnimationModule`.
```ts
import { NzNoAnimationModule } from 'ng-zorro-antd/core/no-animation';
@Component({
imports: [
// ...
NzNoAnimationModule
]
})
```
Add the `nzNoAnimation` directive to the component.
```html
```
### Turn Off In Services
Add the following configuration while invoking components' services.
#### Modal, Drawer
```ts
{
// ...
nzNoAnimation: true
}
```
#### Notification, Message
```ts
{
// ...
nzAnimate: false
}
```
### Turn Off The Wave Effect
Some components use dynamic styles to support wave effects, so their styles are unable to be overridden directly.
Instead, you can use `provideNzWave` or use `NoopAnimationsModule` to turn off the wave effects.
```ts
import { provideNzWave } from 'ng-zorro-antd/core/wave';
export const appConfig: ApplicationConfig = {
providers: [
provideNzWave({ disabled: true })
]
}
```
---
Title: WaterMark
URL: https://ng.ant.design/components/water-mark/en
---
## When To Use
- Use when the page needs to be watermarked to identify the copyright.
- Suitable for preventing information theft.
## API
### nz-water-mark
| Property | Description | Type | Default |
|-------------|---------------------------------------------------------------------------------------------------|---------------------|----------------------------|
| `nzContent` | Watermark text content | `string | string[]` | - |
| `nzWidth` | The width of the watermark, the default value of `nzContent` is its own width | `number` | 120 |
| `nzHeight` | The height of the watermark, the default value of `nzContent` is its own height | `number` | 64 |
| `nzRotate` | When the watermark is drawn, the rotation Angle, unit `°` | `number` | -22 |
| `nzZIndex` | The z-index of the appended watermark element | `number` | 9 |
| `nzImage` | Image source, it is recommended to export 2x or 3x image, high priority (support base64 format) | `string` | - |
| `nzFont` | Text style | `FontType` | FontType |
| `nzGap` | The spacing between watermarks | `[number, number]` | `[100, 100]` |
| `nzOffset` | The offset of the watermark from the upper left corner of the container. The default is `nzGap/2` | `[number, number]` | `[nzGap[0]/2, nzGap[1]/2]` |
### FontType
| Property | Description | Type | Default |
|--------------|-------------|------------------------------------|-------------------|
| `color` | font color | `string` | `rgba(0,0,0,.15)` |
| `fontSize` | font size | `number` | 16 |
| `fontWeight` | font weight | `normal | light | weight | number` | normal |
| `fontFamily` | font family | `string` | sans-serif |
| `fontStyle` | font style | `none | normal | italic | oblique` | normal |
## FAQ
### Handle abnormal image watermarks
When using an image watermark and the image loads abnormally, you can add `nzContent` at the same time to prevent the watermark from becoming invalid.
```html
```
---
Title: Upload
URL: https://ng.ant.design/components/upload/en
---
## When To Use
Uploading is publishing information (web pages, text, pictures, video, etc.) to a remote server via a web page or upload tool.
- When you need to upload one or more files.
- When you need to show the process of uploading.
- When you need to upload files by dragging and dropping.
## API
> You can consult [jQuery-File-Upload](https://github.com/blueimp/jQuery-File-Upload/wiki) about how to implement server-side upload interface.
### nz-upload
| Property | Description | Type | Default |
|-----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|-----------------|
| `[nzAccept]` | File types that can be accepted. See [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept) | `string` | - |
| `[nzAction]` | Required. Uploading URL | `string \| ((file: NzUploadFile) => string \| Observable)` | - |
| `[nzDirectory]` | support uploading the whole directory ([caniuse](https://caniuse.com/#feat=input-file-directory)) | `boolean` | `false` |
| `[nzBeforeUpload]` | Hook function, which will be executed before uploading. Uploading will be stopped with `false` or an Observable. **Warning: this function is not supported in IE9**. NOTICE: Must use `=>` to define the method. | `(file: NzUploadFile, fileList: NzUploadFile[]) => boolean \| Observable` | - |
| `[nzCustomRequest]` | Override for the default XHR behavior allowing for additional customization and the ability to implement your own XMLHttpRequest. NOTICE: Must use `=>` to define the method. | `(item) => Subscription` | - |
| `[nzData]` | Uploading params or function which can return uploading params. NOTICE: Must use `=>` to define the method. | `Object \| ((file: NzUploadFile) => Object \| Observable<{}>)` | - |
| `[nzDisabled]` | disable upload button | `boolean` | `false` |
| `[nzFileList]` | List of files, two-way data-binding | `NzUploadFile[]` | - |
| `[nzLimit]` | limit single upload count when `nzMultiple` has opened. `0` unlimited | `number` | `0` |
| `[nzSize]` | limit file size (KB). `0` unlimited | `number` | `0` |
| `[nzFileType]` | limit file type, e.g: `image/png,image/jpeg,image/gif,image/bmp` | `string` | - |
| `[nzFilter]` | Custom filter when choose file | `UploadFilter[]` | - |
| `[nzHeaders]` | Set request headers, valid above IE10. NOTICE: Must use `=>` to define the method. | `Object \| ((file: NzUploadFile) => Object \| Observable<{}>)` | - |
| `[nzListType]` | Built-in stylesheets, support for three types: `text`, `picture` or `picture-card` | `'text' \| 'picture' \| 'picture-card'` | `'text'` |
| `[nzMultiple]` | Whether to support selected multiple files. `IE10+` supported. You can select multiple files with CTRL holding down while multiple is set to be true | `boolean` | `false` |
| `[nzName]` | The name of the uploading file | `string` | `'file'` |
| `[nzShowUploadList]` | Whether to show the default upload list, could be an object to specify `showPreviewIcon`, `showRemoveIcon` and `showDownloadIcon` individually | `boolean \| { showPreviewIcon?: boolean, showRemoveIcon?: boolean, showDownloadIcon?: boolean }` | `true` |
| `[nzShowButton]` | Show upload button | `boolean` | `true` |
| `[nzWithCredentials]` | ajax upload with cookie sent | `boolean` | `false` |
| `[nzOpenFileDialogOnClick]` | click open file dialog | `boolean` | `true` |
| `[nzPreview]` | A callback function will be executed when the file link or preview icon is clicked. NOTICE: Must use `=>` to define the method. | `(file: NzUploadFile) => void` | - |
| `[nzPreviewFile]` | Customize preview file logic. NOTICE: Must use `=>` to define the method. | `(file: NzUploadFile) => Observable` | - |
| `[nzPreviewIsImage]` | Customize the preview file is an image, generally used when the image URL is in a non-standard format. NOTICE: Must use `=>` to define the method. | `(file: NzUploadFile) => boolean` | - |
| `[nzRemove]` | A callback function will be executed when the removing file button is clicked, remove event will be prevented when the return value is `false` or an Observable. NOTICE: Must use `=>` to define the method. | `(file: NzUploadFile) => boolean \| Observable` | - |
| `(nzChange)` | A callback function, can be executed when uploading state is changing | `EventEmitter` | - |
| `[nzDownload]` | Click the method to download the file, pass the method to perform the method logic, do not pass the default jump to the new TAB. | `(file: NzUploadFile) => void` | Jump to new TAB |
| `[nzTransformFile]` | Customize transform file before request | `(file: NzUploadFile) => NzUploadTransformFileType` | - |
| `[nzIconRender]` | Custom show icon | `TemplateRef<{ $implicit: NzUploadFile }>` | - |
| `[nzFileListRender]` | Custom file list | `TemplateRef<{ $implicit: NzUploadFile[] }>` | - |
#### nzChange
> The function will be called when uploading is in progress, completed or failed
When uploading state changes, it returns:
```js
{
file: { /* ... */ },
fileList: [ /* ... */ ],
event: { /* ... */ },
}
```
1. `file` File object for the current operation.
```js
{
uid: 'uid', // unique identifier
name: 'xx.png' // file name
status: 'done', // options:uploading, done, error, removed
response: '{"status": "success"}', // response from server
linkProps: '{"download": "image"}', // additional html props of file link
}
```
2. `fileList` current list of files
3. `event` response from server, including uploading progress, supported by advanced browsers.
#### nzCustomRequest
Allows for advanced customization by overriding default behavior in `HttpClient`. Provide your own XMLHttpRequest calls to interface with custom backend processes or interact with AWS S3 service through the `aws-sdk` package.
`nzCustomRequest` callback is passed an object with:
- `onProgress: (event: { percent: number }): void`
- `onError: (event: Error): void`
- `onSuccess: (body: Object, xhr?: Object): void`
- `data: Object`
- `filename: String`
- `file: File`
- `withCredentials: Boolean`
- `action: String`
- `headers: Object`
---
Title: Typography
URL: https://ng.ant.design/components/typography/en
---
## When To Use
- When need to display title or paragraph contents in Articles/Blogs/Notes.
- When you need copyable/editable/ellipsis texts.
## API
### [nz-typography]
| Property | Description | Type | Default | Global Config |
| ------------------- | ------------------------------------------------------------------------------ | -------------------------------------------------------------------- | ------------------- | ------------- |
| `[nzContent]` | Component content | `string` | - | |
| `[nzCopyable]` | Can copy, require use `[nzContent]` | `boolean` | `false` | |
| `[nzEditable]` | Editable, require use `[nzContent]` | `boolean` | `false` | |
| `[nzCopyIcons]` | Custom copy icons | `[string \| TemplateRef, string \| TemplateRef]` | `['copy', 'check']` | ✅ |
| `[nzCopyTooltips]` | Custom tooltips text, hide when it is `null` | `null \| [string \| TemplateRef, string \| TemplateRef]` | - | ✅ |
| `[nzEditIcon]` | Custom edit icon | `string \| TemplateRef` | `'edit'` | ✅ |
| `[nzEditTooltip]` | Custom tooltip text, hide when it is `null` | `null \| string \| TemplateRef` | - | ✅ |
| `[nzEllipsis]` | Display ellipsis when overflow, require use `[nzContent]` when dynamic content | `boolean` | `false` | |
| `[nzSuffix]` | The text suffix when used `nzEllipsis` | `string` | - | |
| `[nzCopyText]` | Customize the copy text | `string` | - | |
| `[nzDisabled]` | Disable content | `boolean` | `false` | |
| `[nzExpandable]` | Expandable when ellipsis | `boolean` | `false` | |
| `[nzEllipsisRows]` | Line number | `number` | `1` | ✅ |
| `[nzType]` | Content type | `'secondary' \| 'warning' \| 'danger' \| 'success'` | - | |
| `(nzContentChange)` | Trigger when user edit the content | `EventEmitter` | - | |
| `(nzExpandChange)` | Trigger when user expanded the content | `EventEmitter` | - | |
| `(nzOnEllipsis)` | Trigger when ellipsis status changed | `EventEmitter` | - | |
---
Title: Tree View
URL: https://ng.ant.design/components/tree-view/en
---
## When To Use
More basic Tree component, allowing each of its parts to be defined in the template, and state to be managed manually.
## API
### nz-tree-view
| Property | Description | Type | Default |
|---------------------|----------------------------------------------------|------------------------------------------------------------------------------------------------------------|---------|
| `[nzTreeControl]` | The tree controller | [TreeControl](https://material.angular.io/cdk/tree/api#TreeControl) | - |
| `[nzDataSource]` | The data array to render | [DataSource](https://material.angular.io/cdk/tree/overview#data-source)<T> \| Observable \| T[] | - |
| `[nzDirectoryTree]` | Whether nodes are displayed as directory style | `boolean` | `false` |
| `[nzBlockNode]` | Whether tree nodes fill remaining horizontal space | `boolean` | `false` |
### nz-tree-virtual-scroll-view
The virtual scroll tree view, which can be accessed from
the [CdkVirtualScrollViewport](https://material.angular.io/cdk/scrolling/api#CdkVirtualScrollViewport) instance through
the `virtualScrollViewport` member of the component instance.
| Property | Description | Type | Default |
|---------------------|--------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------|-----------|
| `[nzTreeControl]` | The tree controller | [TreeControl](https://material.angular.io/cdk/tree/api#TreeControl) | - |
| `[nzDataSource]` | The data array to render | [DataSource](https://material.angular.io/cdk/tree/overview#data-source)<T> \| Observable \| T[] | - |
| `[nzDirectoryTree]` | Whether nodes are displayed as directory style | `boolean` | `false` |
| `[nzBlockNode]` | Whether tree nodes fill remaining horizontal space | `boolean` | `false` |
| `[nzItemSize]` | The size of nodes in the tree (in pixels) | `number` | `28` |
| `[nzMinBufferPx]` | The minimum amount of buffer rendered allowed outside the viewport (in pixels) | `number` | `28 * 5` |
| `[nzMaxBufferPx]` | The amount of buffer required for rendering new nodes (in pixels) | `number` | `28 * 10` |
### [nzTreeNodeDef]
Directive to define `nz-tree-node`.
| Property | Description | Type | Default |
|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|---------|
| `[nzTreeNodeDefWhen]` | A matching function which indicates whether inputted node should be used. It matches the very first node that makes this function return `true`. If no nodes that makes this function return `true`, the node which does not define this function would be matched instead. | `(index: number, nodeData: T) => boolean` | - |
### nz-tree-node
The tree node container component, which needs to be defined by the `nzTreeNodeDef` directive.
### [nzTreeNodePadding]
```html
```
Show node indentation by adding `padding` **Best Performance**.
### nzTreeNodeIndentLine
```html
```
Show node indentation by adding indent lines.
### nz-tree-node-toggle
A toggle which is used to expand / collapse the node.
| Property | Description | Type | Default |
|-------------------------------|-------------------------------------|-----------|---------|
| `[nzTreeNodeToggleRecursive]` | Is it recursively expand / collapse | `boolean` | `false` |
### nz-tree-node-toggle[nzTreeNodeNoopToggle]
A toggle that does no actions. This can be used for placeholders or displays icons.
### [nzTreeNodeToggleRotateIcon]
Define an icon in the toggle, which it will automatically rotate depending on the collapse/expand state.
### [nzTreeNodeToggleActiveIcon]
Define an icon in the toggle for an active style, which it can be used for the loading state.
### nz-tree-node-option
Define the selectable feature of a node.
| Property | Description | Type | Default |
|----------------|--------------------------------|----------------------------|---------|
| `[nzSelected]` | Whether the option is selected | `boolean` | `false` |
| `[nzDisabled]` | Whether the option is disabled | `boolean` | `false` |
| `(nzClick)` | Event on click | `EventEmitter` | - |
### nz-tree-node-checkbox
Define the checkbox feature of a node.
| Property | Description | Type | Default |
|---------------------|---------------------------------------|----------------------------|---------|
| `[nzChecked]` | Whether the checkbox is checked | `boolean` | `false` |
| `[nzDisabled]` | Whether the checkbox is disabled | `boolean` | `false` |
| `[nzIndeterminate]` | Whether the checkbox is indeterminate | `boolean` | `false` |
| `(nzClick)` | Event on click | `EventEmitter` | - |
## Classes
### NzTreeFlatDataSource extends DataSource
**Construction Parameters**
| Name | Description |
|-------------------------------------------|------------------------------------------------------------------|
| `treeControl: FlatTreeControl` | The tree controller. |
| `treeFlattener: NzTreeFlattener` | Flattener for convert nested nodes `T` into flattened nodes `F`. |
| `initialData: T[] = []` | Initialized data. |
**Methods**
| Name | Description |
|----------------------------------------------------------------|--------------------------------------------------------------|
| `connect(collectionViewer: CollectionViewer): Observable` | Call from the TreeView component to listen for data updates. |
| `disconnect(): void` | Call when TreeView component is destroyed. |
| `setData(value: T[]): void` | Set the origin data |
| `getData(): T[]` | Get the origin data |
### NzTreeFlattener
Convert nested data with child nodes into node data with level information.
**Construction Parameters**
| Name | Description |
|-------------------------------------------------------------------------|-------------------------------------------------------|
| `transformFunction: (node: T, level: number) => F` | Receive a nested node and return a flattened node |
| `getLevel: (node: F) => number` | Define the method to get the `level` property |
| `isExpandable: (node: F) => boolean` | Methods for defining whether a node is expandable |
| `getChildren: (node: T) => Observable \| T[] \| undefined \| null` | Define methods to get children nodes from nested node |
**Methods**
| Name | Description |
|-------------------------------------------------------------------------|---------------------------------------------------|
| `flattenNodes(structuredData: T[]): F[]` | Receive nested data and return flattened data |
| `expandFlattenedNodes(nodes: F[], treeControl: TreeControl): F[]` | Get flattened node data based on expansion status |
---
Title: TreeSelect
URL: https://ng.ant.design/components/tree-select/en
---
## When To Use
`TreeSelect` is similar to `Select`, but the values are provided in a tree like structure.
Any data whose entries are defined in a hierarchical manner is fit to use this control. Examples of such case may include a corporate hierarchy, a directory structure, and so on.
## API
### nz-tree-select
| Property | Description | Type | Default | Global Config |
|--------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|------------------------------------|---------------|
| `[nzId]` | input id attribute inside the component | `string` | - |
| `[nzAllowClear]` | Whether allow clear | `boolean` | `false` |
| `[nzPlaceHolder]` | Placeholder of the select input | `string` | - |
| `[nzPlacement]` | The position where the selection box pops up | `bottomLeft` `bottomRight` `topLeft` `topRight` | bottomLeft |
| `[nzDisabled]` | Disabled or not | `boolean` | `false` |
| `[nzShowIcon]` | Shows the icon before a TreeNode's title. There is no default style | `boolean` | `false` |
| `[nzShowSearch]` | Whether to display a search input in the dropdown menu(valid only in the single mode) | `boolean` | `false` | ✅ |
| `[nzNotFoundContent]` | Specify content to show when no result matches. | `'string' \| 'TemplateRef'` | - |
| `[nzDropdownMatchSelectWidth]` | Determine whether the dropdown menu and the select input are the same width | `boolean` | `true` | ✅ |
| `[nzDropdownStyle]` | To set the style of the dropdown menu | `object` | - |
| `[nzDropdownClassName]` | classname of dropdown menu | `string` | - |
| `[nzMultiple]` | Support multiple or not, will be `true` when enable `nzCheckable`. | `boolean` | `false` |
| `[nzHideUnMatched]` | Hide unmatched nodes while searching | `boolean` | `false` | ✅ |
| `[nzSize]` | To set the size of the select input | `'large' \| 'small' \| 'default'` | `'default'` | ✅ |
| `[nzStatus]` | Set validation status | `'error' \| 'warning'` | - | |
| `[nzCheckable]` | Whether to show checkbox on the treeNodes | `boolean` | `false` |
| `[nzCheckStrictly]` | Check treeNode precisely; parent treeNode and children treeNodes are not associated | `boolean` | `false` |
| `[nzShowExpand]` | Show a Expand Icon before the treeNodes | `boolean` | `true` | |
| `[nzShowLine]` | Shows a connecting line | `boolean` | `false` | |
| `[nzAsyncData]` | Load data asynchronously (should be used with NzTreeNode.addChildren(...)) | `boolean` | `false` |
| `[nzNodes]` | Data of the treeNodes | `NzTreeNodeOptions[]` | `[]` |
| `[nzDefaultExpandAll]` | Whether to expand all treeNodes by default | `boolean` | `false` |
| `[nzExpandedKeys]` | Default expanded treeNodes | `string[]` | - |
| `[nzDisplayWith]` | How to display the selected node value in the trigger | `(node: NzTreeNode) => string` | `(node: NzTreeNode) => node.title` |
| `[nzMaxTagCount]` | Max tag count to show | number | - |
| `[nzMaxTagPlaceholder]` | Placeholder for not showing tags | TemplateRef<{ $implicit: NzTreeNode[] }> | - |
| `[nzTreeTemplate]` | Custom Nodes | `TemplateRef<{ $implicit: NzTreeNode }>` | - |
| `[nzVariant]` | Variants of TreeSelect | `'outlined' \| 'borderless' \| 'filled' \| 'underlined'` | `outlined` | ✅ |
| `[nzVirtualHeight]` | The height of virtual scroll | `string` | `-` |
| `[nzVirtualItemSize]` | The size of the items in the list, same as [cdk itemSize](https://material.angular.io/cdk/scrolling/api) | `number` | `28` |
| `[nzVirtualMaxBufferPx]` | The number of pixels worth of buffer to render for when rendering new items, same as [cdk maxBufferPx](https://material.angular.io/cdk/scrolling/api) | `number` | `500` |
| `[nzVirtualMinBufferPx]` | The minimum amount of buffer rendered beyond the viewport (in pixels),same as [cdk minBufferPx](https://material.angular.io/cdk/scrolling/api) | `number` | `28` |
| `[nzBackdrop]` | whether or not the overlay should attach a backdrop | `boolean` | `false` |
| `(nzExpandChange)` | Callback function for when a treeNode is expanded or collapsed | `EventEmitter` | - |
#### Methods
| Property | Description | Type |
|--------------------------|---------------------------------------------------|----------------|
| `getTreeNodes` | get all nodes(NzTreeNode) | `NzTreeNode[]` |
| `getTreeNodeByKey` | get NzTreeNode with key | `NzTreeNode` |
| `getCheckedNodeList` | get checked nodes(merged) | `NzTreeNode[]` |
| `getSelectedNodeList` | get selected nodes | `NzTreeNode[]` |
| `getHalfCheckedNodeList` | get half checked nodes | `NzTreeNode[]` |
| `getExpandedNodeList` | get expanded nodes | `NzTreeNode[]` |
| `getMatchedNodeList` | get matched nodes(if `nzSearchValue` is not null) | `NzTreeNode[]` |
---
Title: Tree
URL: https://ng.ant.design/components/tree/en
---
## When To Use
Almost anything can be represented in a tree structure. Examples include directories, organization hierarchies, biological classifications, countries, etc. The `Tree` component is a way of representing the hierarchical relationship between these things. You can also expand, collapse, and select a treeNode within a `Tree`.
## API
### nz-tree
> Tips: According to the current data structure design, you need to ensure that `nzData` is set first, otherwise other attributes will not take effect. After the asynchronous operation returns data, re-assign other attributes to trigger rendering(including `nzExpandAll` `nzExpandedKeys` `nzCheckedKeys` `nzSelectedKeys` `nzSearchValue`). Please refer to [#5152](https://github.com/NG-ZORRO/ng-zorro-antd/issues/5152) to track the optimization progress.
| Property | Description | Type | Default | Global Config |
|--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------|---------|---------------|
| `[nzData]` | Tree data (Reference NzTreeNode) | `NzTreeNodeOptions[] \| NzTreeNode[]` | `[]` |
| `[nzBlockNode]` | Whether treeNode fill remaining horizontal space | `boolean` | `false` | ✅ |
| `[nzCheckable]` | Add a checkbox before the treeNodes | `boolean` | `false` |
| `[nzShowExpand]` | Show a Expand Icon before the treeNodes | `boolean` | `true` | |
| `[nzShowLine]` | Shows a connecting line | `boolean` | `false` | |
| `[nzExpandedIcon]` | Customize an expand icon | `TemplateRef<{ $implicit: NzTreeNode }>` | - |
| `[nzShowIcon]` | Shows the icon before a TreeNode's title. There is no default style | `boolean` | `false` | ✅ |
| `[nzAsyncData]` | Load data asynchronously (should be used with NzTreeNode.addChildren(...)) | `boolean` | `false` |
| `[nzDraggable]` | Specifies whether this Tree is draggable (IE > 8) | `boolean` | `false` |
| `[nzMultiple]` | Allows selecting multiple treeNodes | `boolean` | `false` |
| `[nzHideUnMatched]` | Hide unmatched nodes while searching | `boolean` | `false` | ✅ |
| `[nzCheckStrictly]` | Check treeNode precisely; parent treeNode and children treeNodes are not associated | `boolean` | `false` |
| `[nzTreeTemplate]` | Custom Nodes | `TemplateRef<{ $implicit: NzTreeNode }>` | - |
| `[nzExpandAll]` | Whether to expand all treeNodes | `boolean` | `false` |
| `[nzExpandedKeys]` | Specify the keys of the default expanded treeNodes | `string[]` | `[]` |
| `[nzCheckedKeys]` | Specifies the keys of the default checked treeNodes | `string[]` | `[]` |
| `[nzSelectedKeys]` | Specifies the keys of the default selected treeNodes | `string[]` | `[]` |
| `[nzSearchValue]` | Filter (highlight) treeNodes (see demo `Searchable`), two-way binding | `string` | `null` |
| `[nzSearchFunc]` | Custom matching method, used with `nzSearchValue` | `(node: NzTreeNodeOptions) => boolean` | `null` |
| `[nzBeforeDrop]` | Drop before the second check, allowing the user to decide whether to allow placement | `(confirm: NzFormatBeforeDropEvent) => Observable` | - |
| `[nzVirtualHeight]` | The height of virtual scroll | `string` | `-` |
| `[nzVirtualItemSize]` | The size of the items in the list, same as [cdk itemSize](https://material.angular.io/cdk/scrolling/api) | `number` | `28` |
| `[nzVirtualMaxBufferPx]` | The number of pixels worth of buffer to render for when rendering new items, same as [cdk maxBufferPx](https://material.angular.io/cdk/scrolling/api) | `number` | `500` |
| `[nzVirtualMinBufferPx]` | The minimum amount of buffer rendered beyond the viewport (in pixels),same as [cdk minBufferPx](https://material.angular.io/cdk/scrolling/api) | `number` | `28` |
| `(nzClick)` | Callback function for when the user clicks a treeNode | `EventEmitter` | - |
| `(nzDblClick)` | Callback function for when the user double clicks a treeNode | `EventEmitter` | - |
| `(nzContextMenu)` | Callback function for when the user right clicks a treeNode | `EventEmitter` | - |
| `(nzCheckboxChange)` | Callback function for when user clicks the checkbox | `EventEmitter` | - |
| `(nzExpandChange)` | Callback function for when a treeNode is expanded or collapsed | `EventEmitter` | - |
| `(nzSearchValueChange)` | Callback function for when filter treeNodes(used with `nzSearchValue`) | `EventEmitter` | - |
| `(nzOnDragStart)` | Callback function for when the onDragStart event occurs | `EventEmitter` | - |
| `(nzOnDragEnter)` | Callback function for when the onDragEnter event occurs | `EventEmitter` | - |
| `(nzOnDragOver)` | Callback function for when the onDragOver event occurs | `EventEmitter` | - |
| `(nzOnDragLeave)` | Callback function for when the onDragLeave event occurs | `EventEmitter` | - |
| `(nzOnDrop)` | Callback function for when the onDrop event occurs | `EventEmitter` | - |
| `(nzOnDragEnd)` | Callback function for when the onDragEnd event occurs | `EventEmitter` | - |
#### Methods
| Property | Description | Type |
|--------------------------|-------------------------------------------------|----------------|
| `getTreeNodes` | get all nodes(NzTreeNode) | `NzTreeNode[]` |
| `getTreeNodeByKey` | get NzTreeNode with key | `NzTreeNode` |
| `getCheckedNodeList` | get checked nodes(merged) | `NzTreeNode[]` |
| `getSelectedNodeList` | get selected nodes | `NzTreeNode[]` |
| `getHalfCheckedNodeList` | get half checked nodes | `NzTreeNode[]` |
| `getExpandedNodeList` | get expanded nodes | `NzTreeNode[]` |
| `getMatchedNodeList` | get matched nodes(if nzSearchValue is not null) | `NzTreeNode[]` |
#### NzTreeNodeOptions props
| Property | Description | Type | Default |
|-------------------|----------------------------------------------------------|-----------------------|---------|
| `title` | Title | `string` | `'---'` |
| `key` | Must be unique! | `string` | `null` |
| `icon` | icon before the treeNode,used with `nzShowIcon` | `string` | `null` |
| `children` | TreeNode's children | `NzTreeNodeOptions[]` | `[]` |
| `isLeaf` | Determines if this is a leaf node(can not be dropped to) | `boolean` | `false` |
| `checked` | Set the treeNode be checked | `boolean` | `false` |
| `selected` | Set the treeNode be selected | `boolean` | `false` |
| `expanded` | Set the treeNode be expanded () | `boolean` | `false` |
| `selectable` | Set whether the treeNode can be selected | `boolean` | `true` |
| `disabled` | Disables the treeNode | `boolean` | `false` |
| `disableCheckbox` | Disables the checkbox of the treeNode | `boolean` | `false` |
| `[key: string]` | Indexable Types, can be used with NzTreeNode.origin | `any ` | - |
#### NzFormatEmitEvent props
| Property | Description | Type | Default |
|-----------------|-----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|---------|
| `eventName` | Event Name | enum: `click` `dblclick` `contextmenu` `check` `expand` `search` & `dragstart` `dragenter` `dragover` `dragleave` `drop` `dragend` | - |
| `node ` | The current operation node (such as the target node to drop while dragging) | `NzTreeNode` | `null` |
| `event` | MouseEvent or DragEvent | `'MouseEvent' \| 'DragEvent'` | `null` |
| `dragNode?` | Current drag node (existing if dragged) | `NzTreeNode` | `null` |
| `selectedKeys?` | Selected nodes list | `NzTreeNode[]` | `[]` |
| `checkedKeys?` | Checked nodes list | `NzTreeNode[]` | `[]` |
| `matchedKeys?` | Matched keys list while searching | `NzTreeNode[]` | `[]` |
| `keys?` | All nodes' keys list related event(except drag events) | `string[]` | `[]` |
| `nodes?` | All nodes related event(except drag events) | `NzTreeNode[]` | `[]` |
#### NzFormatBeforeDropEvent props
| Property | Description | Type | Default |
|----------|----------------------------------------------------------------------------------------------------|--------------|---------|
| dragNode | Current drag node (existing when dragged) | `NzTreeNode` | - |
| node | The current operation node (such as the target node to drop while dragging) | `NzTreeNode` | - |
| pos | position to drop(-1: before the target node, 0: inside the target node, 1: behind the target node) | `number` | - |
#### NzTreeNode props
| Property | Description | Type | Default |
|---------------------|---------------------------------------------------------------------------------------------------------------------|----------------------------------------|-------------------------|
| `title` | Title | `string` | NzTreeNodeOptions.title |
| `key` | Key | `string` | NzTreeNodeOptions.key |
| `level` | TreeNode's level relative to the root node | `number` | `number` |
| `children` | Children | NzTreeNode[] | `[]` |
| `origin` | treeNode's raw data of NzTreeNodeOptions(user provided to show more data) | NzTreeNodeOptions | - |
| `getParentNode` | Get parentNode | function | `null` |
| `isLeaf` | Whether treeNode is a Leaf Node | `boolean` | `false` |
| `isExpanded` | Whether treeNode is expanded | `boolean` | `false` |
| `isDisabled` | Whether treeNode is disabled | `boolean` | `false` |
| `isDisableCheckbox` | Whether treeNode's checkbox can not be clicked | `boolean` | `false` |
| `isSelectable` | Set whether the treeNode can be selected | `boolean` | `true` |
| `isChecked` | Whether treeNode is checked | `boolean` | `false` |
| `isHalfChecked` | Part of treeNode's children are checked | `boolean` | `false` |
| `isSelected` | Whether treeNode is selected | `boolean` | `false` |
| `isLoading` | Whether treeNode is loading(when nzAsyncData is true) | `boolean` | `false` |
| `isMatched` | Whether treeNode's title contains nzSearchValue | `boolean` | `false` |
| `setSyncChecked` | set isChecked value and sync other nodes' state of checkbox | function | - |
| `getChildren` | Get all children | function | - |
| `addChildren` | Add child nodes, receive NzTreeNode or NzTreeNodeOptions array, the second parameter is the inserted index position | (children: array, index?: number )=>{} | - |
| `clearChildren` | Clear the treeNode's children | function | - |
| `remove` | Clear current node(not root node) | function | - |
## Note
- Please make sure `nzData` is set before the mentioned properties above:
```typescript
// Demo
this.nzExpandAll = false;
const nodes = []; // source data
this.nzData = [...nodes];
// Reset the above mentioned properties if you have used after setting of nzData
this.nzExpandedKeys = [...this.nzExpandedKeys];
// this.nzExpandAll = true;
this.nzCheckedKeys = [...this.nzCheckedKeys];
this.nzSelectedKeys = [...this.nzSelectedKeys];
```
- `NzTreeNodeOptions` accepts your custom properties,use `NzTreeNode.origin` to get them.
- If Tree Methods are used with ViewChild, should be used in ngAfterViewInit.
- Setting `nzData` with NzTreeNodeOptions[] is better,if you set nzData with NzTreeNode[], it will be deprecated in next major version(8.x).
---
Title: Transfer
URL: https://ng.ant.design/components/transfer/en
---
## When To Use
- It is a select control essentially which can be use for selecting multiple items.
- Transfer can display more information for items and take up more space.
Transfer the elements between two columns intuitively and efficiently.
One or more elements can be selected from either column, one click on the proper `direction` button, and the transfer is done. The left column is considered the `source` and the right column is considered the `target`. As you can see in the API description, these names are reflected in.
## API
### nz-transfer
| Property | Description | Type | Default |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | --------------------- |
| `[nzDataSource]` | Used for setting the data source. Except for the elements whose keys are `direction: 'right'` prop, or using `nzTargetKeys` prop. | `TransferItem[]` | `[]` |
| `[nzDisabled]` | Whether the transfer is disabled | `boolean` | `false` |
| `[nzTitles]` | A set of titles that are sorted from left to right. | `string[]` | `['', '']` |
| `[nzOperations]` | A set of operations that are sorted from bottom to top. | `string[]` | `['', '']` |
| `[nzListStyle]` | A custom CSS style used for rendering the transfer columns. equals to `ngStyle` | `object` | - |
| `[nzItemUnit]` | single unit | `string` | `'item'` |
| `[nzItemsUnit]` | multiple unit | `string` | `'items'` |
| `[nzRenderList]` | Customize render list, please refer to the case. | `Array \| null>` | `[null, null]` |
| `[nzRender]` | The function to generate the item shown on a column. please refer to the case. | `TemplateRef` | - |
| `[nzFooter]` | A function used for rendering the footer. please refer to the case. | `TemplateRef` | - |
| `[nzShowSelectAll]` | Whether to display the select all box | `boolean` | `true` |
| `[nzShowSearch]` | Whether a search box is shown on each column. | `boolean` | `false` |
| `[nzFilterOption]` | A function to determine whether an item should be shown in a search result list | `(inputValue: string, item: TransferItem) => boolean` | - |
| `[nzSearchPlaceholder]` | The hint text of the search box. | `string` | `'Search here'` |
| `[nzNotFoundContent]` | Text to display when a column is empty. | `string` | `'The list is empty'` |
| `[nzCanMove]` | A function to determine what items should be moved (by default all checked items are moved). please refer to the case. | `(arg: TransferCanMove) => Observable` | - |
| `[nzSelectedKeys]` | A set of keys of selected items. | `string[]` | - |
| `[nzTargetKeys]` | A set of keys of elements that are listed on the right column. | `string[]` | - |
| `[nzOneWay]` | Display as single direction style | `boolean` | `false` |
| `[nzStatus]` | Set validation status | `'error' \| 'warning'` | - |
| `(nzChange)` | A callback function that is executed when the transfer between columns is complete. | `EventEmitter` | - |
| `(nzSearchChange)` | A callback function which is executed when search field are changed | `EventEmitter` | - |
| `(nzSelectChange)` | A callback function which is executed when selected items are changed. | `EventEmitter` | - |
#### TransferItem
| Property | Description | Type | Default |
| --------- | ----------------------------------------------------------------------------------------------- | ------------------- | ------- |
| title | Used to display and search keyword | `string` | - |
| direction | Used for setting the data source. Except the elements whose keys are `direction: 'right'` prop. | `'left' \| 'right'` | - |
| disabled | specifies whether the checkbox is disabled | `boolean` | `false` |
| checked | specifies whether the checkbox is selected | `boolean` | `false` |
#### TransferCanMove
| Property | Description | Type | Default |
| --------- | --------------------------------- | ------------------- | ------- |
| direction | data direction | `'left' \| 'right'` | - |
| list | Used for setting the source data. | `TransferItem[]` | `[]` |
#### TransferChange
| Property | Description | Type | Default |
| -------- | --------------------------------- | ------------------- | ------- |
| from | data direction | `'left' \| 'right'` | - |
| to | data direction | `'left' \| 'right'` | - |
| list | Used for setting the source data. | `TransferItem[]` | `[]` |
#### TransferSearchChange
| Property | Description | Type | Default |
| --------- | -------------- | ------------------- | ------- |
| direction | data direction | `'left' \| 'right'` | - |
| value | Search keyword | `string` | - |
#### nzRenderList
| Property | Description | Type | Default |
| ----------------- | ----------------------- | ------------------------------ | ------- |
| `direction` | List render direction | `'left' \| 'right'` | - |
| `disabled` | Disable list or not | `boolean` | - |
| `items` | Filtered items | `TransferItem[]` | - |
| `onItemSelect` | Select item | `(item: TransferItem) => void` | - |
| `onItemSelectAll` | Select a group of items | `(selected: boolean) => void` | - |
---
Title: Tooltip
URL: https://ng.ant.design/components/tooltip/en
---
## When To Use
- The Tooltip doesn't support complex text or operations. The tip is shown on mouse enter and is hidden on mouse leave.
- To provide an explanation fo a `button/text/operation`. It's often used instead of the HTML `title` attribute to explain `button/text/operation`.
## API
### [nz-tooltip]
| Property | Description | Type | Default |
|---------------------------------|------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|
| `[nzTooltipArrowPointAtCenter]` | Arrow point at center of the origin | `boolean` | `false` |
| `[nzTooltipTitle]` | The text shown in the tooltip | `string \| TemplateRef` | - |
| `[nzTooltipTitleContext]` | The context of tooltip title | `object` | - |
| `[nzTooltipTrigger]` | Tooltip trigger mode. If set to `null` it would not be triggered | `'click' \| 'focus' \| 'hover' \| null` | `'hover'` |
| `[nzTooltipPlacement]` | The position of the tooltip relative to the target | `'top' \| 'left' \| 'right' \| 'bottom' \| 'topLeft' \| 'topRight' \| 'bottomLeft' \| 'bottomRight' \| 'leftTop' \| 'leftBottom' \| 'rightTop' \| 'rightBottom' \| Array` | `'top'` |
| `[nzTooltipColor]` | The background color | `string` | - |
| `[nzTooltipOrigin]` | Origin of the tooltip | `ElementRef` | - |
| `[nzTooltipVisible]` | Show or hide tooltip | `boolean` | `false` |
| `(nzTooltipVisibleChange)` | Callback of hide or show | `EventEmitter` | - |
| `[nzTooltipMouseEnterDelay]` | Delay in seconds, before tooltip is shown on mouse enter | `number` | `0.15` |
| `[nzTooltipMouseLeaveDelay]` | Delay in seconds, before tooltip is hidden on mouse leave | `number` | `0.1` |
| `[nzTooltipOverlayClassName]` | Class name of the tooltip card | `string` | - |
| `[nzTooltipOverlayStyle]` | Style of the tooltip card | `object` | - |
### Common API
The following APIs are shared by `nz-tooltip`, `nz-popconfirm`, `nz-popover`.
| Method | Description |
|--------------------|-----------------|
| `show()` | Show |
| `hide()` | Hide |
| `updatePosition()` | Update position |
## Exclude body element's scroll event need to refresh the position of CDK
In using the tooltip (including popconfirm、popover), the body element's scroll event will update the position of the tooltip. It will never update the tooltip's position if the scroll event happens in a custom element. You can add the `cdkScrollable` directive to achieve the goal. Take notice that you need to import relative package `import { ScrollingModule } from '@angular/cdk/scrolling';`, for more information you can visit [scrolling/api](https://material.angular.io/cdk/scrolling/api).
## Note
Please ensure that the node of `[nz-tooltip]` accepts `onMouseEnter`, `onMouseLeave`, `onFocus`, `onClick` events.
---
Title: Timeline
URL: https://ng.ant.design/components/timeline/en
---
## When To Use
- When a series of information needs to be ordered by time (ascend or descend).
- When you need a timeline to make a visual connection.
## API
```html
step1 2015-09-01step2 2015-09-01step3 2015-09-01step4 2015-09-01
```
### nz-timeline
Timeline
| Property | Description | Type | Default |
| ---------------- | ----------------------------------------------------------------------------------- | ---------------------------------------------- | ---------------------------------------- |
| `[nzPending]` | Set the last ghost node's existence or its content | `string\|boolean\|TemplateRef` | `false` |
| `[nzPendingDot]` | Set the dot of the last ghost node when pending is true | `string\|TemplateRef` | `` |
| `[nzReverse]` | Reverse nodes or not | `boolean` | `false` |
| `[nzMode]` | By sending `alternate` the timeline will distribute the nodes to the left and right | `'left' \| 'alternate' \| 'right' \| 'custom'` | - |
### nz-timeline-item
Node of timeline
| Property | Description | Type | Default |
| -------------- | --------------------------------------------------------------------------------------- | ----------------------------- | ------- |
| `[nzColor]` | Set the circle's color to `'blue' \| 'red' \| 'green' \| 'gray'` or other custom colors | `string` | `blue` |
| `[nzDot]` | Customize timeline dot | `string \| TemplateRef` | - |
| `[nzPosition]` | Customize position, only works when `nzMode` is `custom` | `'left' \| 'right'` | - |
| `[nzLabel]` | Set the label | `string \| TemplateRef` | - |
---
Title: TimePicker
URL: https://ng.ant.design/components/time-picker/en
---
## When To Use
By clicking the input box, you can select a time from a popup panel.
## API
### nz-time-picker
| Property | Description | Type | Default | Global Config |
|---------------------------|----------------------------------------------------------------------------------------|----------------------------------------------------------|-------------------|---------------|
| `[nzId]` | input id attribute inside the component | `string` | - |
| `[ngModel]` | to set time | `Date` | - |
| `[nzAddOn]` | called from timepicker panel to render some addon to its bottom | `TemplateRef` | - |
| `[nzAllowEmpty]` | allow clearing text | `boolean` | `true` | ✅ |
| `[nzAutoFocus]` | get focus when component mounted | `boolean` | `false` |
| `[nzBackdrop]` | whether or not the overlay should attach a backdrop | `boolean` | `false` |
| `[nzClearText]` | clear tooltip of icon | `string` | `'clear'` | ✅ |
| `[nzNowText]` | text of the Now button | `string` | `'Now'` | ✅ |
| `[nzOkText]` | text of the Ok button | `string` | `'Ok'` | ✅ |
| `[nzDefaultOpenValue]` | default open panel value if `[ngModel]` is null | `Date` | `new Date()` |
| `[nzDisabled]` | determine whether the TimePicker is disabled | `boolean` | `false` |
| `[nzDisabledHours]` | to specify the hours that cannot be selected | `() => number[]` | - |
| `[nzDisabledMinutes]` | to specify the minutes that cannot be selected | `(hour: number) => number[]` | - |
| `[nzDisabledSeconds]` | to specify the seconds that cannot be selected | `(hour: number, minute: number) => number[]` | - |
| `[nzFormat]` | to set the time format | [DatePipe](https://angular.dev/api/common/DatePipe) | `"HH:mm:ss"` | ✅ |
| `[nzHideDisabledOptions]` | hide the options that can not be selected | `boolean` | `false` |
| `[nzHourStep]` | interval between hours in picker | `number` | `1` | ✅ |
| `[nzMinuteStep]` | interval between minutes in picker | `number` | `1` | ✅ |
| `[nzSecondStep]` | interval between seconds in picker | `number` | `1` | ✅ |
| `[nzSize]` | width of time picker box | `'large' \| 'small' \| 'default'` | `'default'` |
| `[nzStatus]` | Set validation status | `'error' \| 'warning'` | - |
| ~~`[nzBorderless]`~~ | ~~remove the border~~ | ~~`boolean`~~ | ~~`false`~~ | - |
| `[nzVariant]` | Variants of TimePicker | `'outlined' \| 'borderless' \| 'filled' \| 'underlined'` | `outlined` | ✅ |
| `[nzInputReadOnly]` | set the readonly attribute of the input tag (avoids virtual keyboard on touch devices) | `boolean` | `false` | - |
| `[nzOpen]` | whether to popup panel, double binding | `boolean` | `false` |
| `[nzPlaceHolder]` | display when there's no value | `string` | `"Select a time"` |
| `[nzPopupClassName]` | className of panel | `string` | `''` | ✅ |
| `[nzUse12Hours]` | display as 12 hours format, with default format `h:mm:ss a` | `boolean` | `false` | ✅ |
| `[nzSuffixIcon]` | the custom suffix icon | `string` \| `TemplateRef` | - | ✅ |
| `(ngModelChange)` | a callback function, can be executed when the selected time is changing | `EventEmitter` | - |
| `(nzOpenChange)` | a callback function which will be called while panel opening/closing | `EventEmitter` | - |
#### Methods
| Name | Description |
| --------- | ------------ |
| `blur()` | remove focus |
| `focus()` | get focus |
---
Title: Tag
URL: https://ng.ant.design/components/tag/en
---
## When To Use
- It can be used to tag by dimension or property.
- When categorizing.
## API
### nz-tag
| Property | Description | Type | Default |
| ------------------- | --------------------------------------------------------------------------- | ----------------------------------------- | ----------- |
| `[nzMode]` | Mode of tag | `'closeable' \| 'default' \| 'checkable'` | `'default'` |
| `[nzChecked]` | Checked status of Tag, double binding, only works when `nzMode="checkable"` | `boolean` | `false` |
| `[nzColor]` | Color of the Tag | `string` | - |
| `[nzBordered]` | Whether has border style | `boolean` | `true` |
| `(nzOnClose)` | Callback executed when tag is closed, only works when `nzMode="closable"` | `EventEmitter` | - |
| `(nzCheckedChange)` | Checked status change call back, only works when `nzMode="checkable"` | `EventEmitter` | - |
---
Title: Tabs
URL: https://ng.ant.design/components/tabs/en
---
## When To Use
Ant Design has 3 types of Tabs for different situations.
- Card Tabs: for managing too many closeable views.
- Normal Tabs: for functional aspects of a page.
- [RadioButton](/components/radio/en/#components-radio-demo-radiobutton): for secondary tabs.
## API
### nz-tabs
| Property | Description | Type | Default | Global Config |
|------------------------------|-------------------------------------------------------------------------------------------|-----------------------------------------------------|------------------------------------|---------------|
| `[nzSelectedIndex]` | Current tab's index | `number` | - |
| `[nzAnimated]` | Whether to change tabs with animation. Only works while `nzTabPosition="top" \| "bottom"` | `boolean \| {inkBar:boolean, tabPane:boolean}` | `true`, `false` when `type="card"` | ✅ |
| `[nzSize]` | preset tab bar size | `'large' \| 'small' \| 'default'` | `'default'` | ✅ |
| `[nzTabBarExtraContent]` | Extra content in tab bar | `TemplateRef` | - |
| `[nzTabBarStyle]` | Tab bar style object | `object` | - |
| `[nzTabPosition]` | Position of tabs | `'top' \| 'right' \| 'bottom' \| 'left'` | `'top'` | |
| `[nzType]` | Basic style of tabs | `'line' \| 'card' \| 'editable-card'` | `'line'` | ✅ |
| `[nzTabBarGutter]` | The gap between tabs | `number` | - | ✅ |
| `[nzHideAll]` | Whether hide all tabs | `boolean` | `false` |
| `[nzLinkRouter]` | Link with Angular router. It supports child mode and query param mode | `boolean` | `false` | |
| `[nzLinkExact]` | Use exact routing matching | `boolean` | `true` |
| `[nzCanDeactivate]` | Determine if a tab can be deactivated | `NzTabsCanDeactivateFn` | - |
| `[nzCentered]` | Centers tabs | `boolean` | `false` |
| `[nzDestroyInactiveTabPane]` | Whether destroy inactive TabPane when change tab | `boolean` | `false` |
| `(nzSelectedIndexChange)` | Current tab's index change callback | `EventEmitter` | - |
| `(nzSelectChange)` | Current tab's change callback | `EventEmitter<{index: number,tab: NzTabComponent}>` | - |
### nz-tabs[nzType="editable-card"]
| Property | Description | Type | Default | Global Config |
|---------------|--------------------------------|-----------------------------------|---------|---------------|
| `[nzHideAdd]` | Hide plus icon or not | `boolean` | `false` |
| `[nzAddIcon]` | Add icon | `string \| TemplateRef` | - |
| `(nzAdd)` | When add button clicked emit | `EventEmitter<>` | - |
| `(nzClose)` | When close button clicked emit | `EventEmitter<{ index: number }>` | - |
### nz-tab
| Property | Description | Type | Default |
|-------------------|--------------------------------------------------------------------------|-------------------------------|---------|
| `[nzTitle]` | Show text in tab's head | `string \| TemplateRef` | - |
| `[nzForceRender]` | Forced render of content in tabs, not lazy render after clicking on tabs | `boolean` | `false` |
| `[nzDisabled]` | tab disable | `boolean` | - |
| `(nzClick)` | title click callback | `EventEmitter` | - |
| `(nzContextmenu)` | title contextmenu callback | `EventEmitter` | - |
| `(nzSelect)` | title select callback | `EventEmitter` | - |
| `(nzDeselect)` | title deselect callback | `EventEmitter` | - |
### nz-tabs[nzType="editable-card"] > nz-tab
| Property | Description | Type | Default | Global Config |
|-----------------|------------------------|-------------------------------|---------|---------------|
| `[nzClosable]` | Show close icon or not | `boolean` | `false` |
| `[nzCloseIcon]` | Close icon | `string \| TemplateRef` | - |
#### Template variable references of `nz-tab[nzTitle]`
| Property | Description | Type |
|-----------|-------------------------------------------------------------------------------------|-----------|
| `visible` | Is the title in the visible area, will be rendered to the dropdown menu if `false`. | `boolean` |
Use in `nz-tab[nzTitle]`
```html
...
...
```
Use in `*nzTabLink`
```html
...
```
### [nz-tab]
Tab contents can be lazy loaded by declaring the body in a `ng-template` with the `[nz-tab]` attribute.
### ng-template[nzTabLink] > a[nz-tab-link]
Show a link in tab's head. Used in router link mode.
```html
Link
Default.
```
### [nzTabBarExtraContent]
> Note: `*nzTabBarExtraContent` has a higher priority than `nz-tabs[nzTabBarExtraContent]`.
| Property | Description | Type | Default | Global Config |
|--------------------------|---------------------------|--------------------|---------|---------------|
| `[nzTabBarExtraContent]` | Position of extra content | `'start' \| 'end'` | `'end'` |
---
Title: Table
URL: https://ng.ant.design/components/table/en
---
## When To Use
- To display a collection of structured data.
- To sort, search, paginate and filter data.
## How To Use
The Table component is both easy to use and highly customizable.
### Highly Customizable
The `nz-table` can be used like [` W3C Standard
`](https://www.w3.org/TR/html401/struct/tables.html). Developers can control every part of the table as they wish.
### Component Enhancements
The component in `nz-table` such as `th`, `td`, `thead` etc. are enhanced. Developers can make the table sortable, filterable, with fixed header, perform server side rendering etc. easily with the provided api.
### Data Processing
The data passed to `[nzData]` is exported with [Template Context](https://angular.dev/guide/templates/template-statements#statement-context) after processing (including paging, sorting and filtering). `*ngFor` can be used to render current page data in table.
```html
```
## API
### nz-table
| Property | Description | Type | Default | Global Config |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | ------------------ | ------------- |
| `[nzData]` | Data record array to be rendered | `T[]` | - |
| `[nzFrontPagination]` | Whether to paginate data on client. Should be set to `false` if data is to be paginated on server side or if all the data is to be displayed at once in the table without any pagination | `boolean` | `true` |
| `[nzTotal]` | Total data count. Should set when `nzFrontPagination` is `false` | `number` | - |
| `[nzCustomColumn]` | Control the display and sorting of table columns, (after enabling `nzWidthConfig` and `[nzWidth]` of `th` will not take effect) | `NzCustomColumn[]` | - |
| `[nzPageIndex]` | pageIndex , double binding | `number` | - |
| `[nzPageSize]` | pageSize, double binding | `number` | - |
| `[nzShowPagination]` | Whether to show pagination component at bottom of the table | `boolean` | `true` |
| `[nzPaginationPosition]` | Specify the position of pagination | `'top' \| 'bottom' \| 'both'` | `bottom` |
| `[nzPaginationType]` | Specify the size of pagination | `'default' \| 'small'` | `default` |
| `[nzBordered]` | Whether to show all table borders | `boolean` | `false` | ✅ |
| `[nzOuterBordered]` | Whether to show table outer borders | `boolean` | `false` | - |
| `[nzWidthConfig]` | Set col width can not used with `[nzWidth]` of `th` | `string[]` | `[]` |
| `[nzSize]` | Size of table | `'middle' \| 'small' \| 'default'` | `'default'` | ✅ |
| `[nzLoading]` | Loading status of table | `boolean` | `false` |
| `[nzLoadingIndicator]` | The loading indicator | `TemplateRef` | - | ✅ |
| `[nzLoadingDelay]` | Specifies a delay in milliseconds for loading state (prevents flush) | `number` | `0` |
| `[nzScroll]` | Whether table can be scrolled in x/y direction. `x` or `y` can be a string that indicates the width and height of table body | `object` | - |
| `[nzTitle]` | Table title renderer | `string \| TemplateRef` | - |
| `[nzFooter]` | Table footer renderer | `string \| TemplateRef` | - |
| `[nzNoResult]` | Custom no result content | `string \| TemplateRef` | - |
| `[nzPageSizeOptions]` | Specify the sizeChanger options | `number[]` | `[10, 20, 30, 40]` |
| `[nzShowQuickJumper]` | Determine whether you can jump to pages directly | `boolean` | `false` | ✅ |
| `[nzShowSizeChanger]` | Determine whether `nzPageSize` can be changed | `boolean` | `false` | ✅ |
| `[nzShowTotal]` | To display Pagination total number and range, same as Pagination | `TemplateRef<{ $implicit: number, range: [ number, number ] }>` | - |
| `[nzItemRender]` | To customize Pagination item, same as Pagination | `TemplateRef<{ $implicit: 'page' \| 'prev' \| 'next', page: number }>` | - |
| `[nzHideOnSinglePage]` | Whether to hide pagination on single page | `boolean` | `false` |
| `[nzSimple]` | Whether to use simple mode | `boolean` | - | ✅ |
| `[nzTemplateMode]` | Template mode,no need to pass data to `nzData` | `boolean` | `false` |
| `[nzVirtualItemSize]` | The size of the items in the list, same as [cdk itemSize](https://material.angular.io/cdk/scrolling/api) | `number` | `0` |
| `[nzVirtualMaxBufferPx]` | The number of pixels worth of buffer to render for when rendering new items, same as [cdk maxBufferPx](https://material.angular.io/cdk/scrolling/api) | `number` | `200` |
| `[nzVirtualMinBufferPx]` | The minimum amount of buffer rendered beyond the viewport (in pixels),same as [cdk minBufferPx](https://material.angular.io/cdk/scrolling/api) | `number` | `100` |
| `[nzVirtualForTrackBy]` | The TrackByFunction to be used for tracking changes. | `TrackByFunction` | - |
| `[noDataVirtualHeight]` | Height of inner scroll when having no data, if nothing is passed the default value is used. | `string` | `'182px'` |
| `(nzPageIndexChange)` | Callback when `pageIndex` changes | `EventEmitter` | - |
| `(nzPageSizeChange)` | Callback when `pageSize` changes | `EventEmitter` | - |
| `(nzCurrentPageDataChange)` | Callback when current pageData changes | `EventEmitter` | - |
| `(nzCustomColumnChange)` | Callback when the table is reordered | `EventEmitter` | - |
| `(nzQueryParams)` | Callback with params when working with server side pagination, sorting and filtering | `EventEmitter` | - |
### th
Checkbox property
| Property | Description | Type | Default |
| ------------------- | --------------------------------------------------- | ----------------------- | ------- |
| `[nzShowCheckbox]` | Whether `nz-checkbox` should be shown in the header | `boolean` | - |
| `[nzDisabled]` | Whether the `nz-checkbox` is disabled | `boolean` | - |
| `[nzIndeterminate]` | `nz-checkbox` indeterminate status | `boolean` | - |
| `[nzLabel]` | ARIA label for the `nz-checkbox` | `string` | - |
| `[nzChecked]` | Checked status, double binding | `boolean` | - |
| `(nzCheckedChange)` | Callback when checked status changes | `EventEmitter` | - |
Selection property
| Property | Description | Type | Default |
| ---------------------- | ------------------------------------------------------------------- | ---------------------------------------- | ------- |
| `[nzShowRowSelection]` | Whether to show row selection options | `boolean` | - |
| `[nzSelections]` | Selection options including `text` and `onSelect` callback function | `Array<{ text: string, onSelect: any }>` | - |
Sort property
| Property | Description | Type | Default |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- | ----------------------------- |
| `[nzShowSort]` | Whether to display sorting | `boolean` | - |
| `[nzSortFn]` | Sort function used to sort the data on client side (ref to Array.sort compareFunction). Should be set to `true` when using server side sorting | `NzTableSortFn \| boolean` | - |
| `[nzSortOrder]` | Sort direction | `'ascend' \| 'descend' \| null` | - |
| `[nzSortDirections]` | Supported sort order, could be `'ascend'`, `'descend'`, `null` | `Array<'ascend' \| 'descend' \| null>` | `['ascend', 'descend', null]` | ✅ |
| `(nzSortOrderChange)` | Callback when sort direction changes | `EventEmitter<'ascend' \| 'descend' \| null>` | - |
Filter property
| Property | Description | Type | Default |
| -------------------- | ------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------- | ------- |
| `[nzShowFilter]` | Whether to show filter | `boolean` | - |
| `[nzFilterFn]` | Filter function used to filter the data on client side. Set to `true` when using server side filtering | `NzTableFilterFn \| boolean` | - |
| `[nzFilters]` | Filter options, `text`, and `value` for callback, `byDefault` to enable filter by default | `Array<{ text: string; value: any; byDefault?: boolean }>` | - |
| `[nzFilterMultiple]` | Whether multiple mode filtering is enabled | `boolean` | `true` |
| `(nzFilterChange)` | Callback when filter `value` changes | `EventEmitter` | - |
Style property
| Property | Description | Type | Default |
| ----------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------- | ------- |
| `[nzWidth]` | Specify the column width (in pixels), can not used when grouping columns | `string` | - |
| `[nzLeft]` | Left pixels, used to fixed column to left, auto calc when set to `true` and disable fixed when `false` | `string \| boolean` | - |
| `[nzRight]` | Right pixels, used to fixed column to right, auto calc when set to `true` and disable fixed when `false` | `string \| boolean` | - |
| `[nzAlign]` | Specify how content is aligned | `'left' \| 'right' \| 'center'` | - |
| `[nzCellControl]` | Set the position of the column, which is the value of the `value` field in the `NzCustomColumn` type | `string` | - |
| `[nzBreakWord]` | Whether insert line breaks within words | `boolean` | `false` |
| `[nzEllipsis]` | ellipsis cell content, not working with sorter and filters for now. Only work when nzTableLayout was `fixed` | `boolean` | `false` |
Other
| Property | Description | Type | Default |
| --------------- | -------------------------------------------- | -------- | ------- |
| `[nzColumnKey]` | column key, work with server sort and filter | `string` | - |
### td
Checkbox property
| Property | Description | Type | Default |
| ------------------- | --------------------------------- | ----------------------- | ------- |
| `[nzShowCheckbox]` | Whether add nz-checkbox | `boolean` | - |
| `[nzDisabled]` | Whether disable checkbox | `boolean` | - |
| `[nzIndeterminate]` | Indeterminate status | `boolean` | - |
| `[nzLabel]` | ARIA label for the `nz-checkbox` | `string` | - |
| `[nzChecked]` | Checked status, double binding | `boolean` | - |
| `(nzCheckedChange)` | Checked status change callback | `EventEmitter` | - |
| `[colSpan]` | how many columns the cell extends | `number` | `null` |
| `[rowSpan]` | how many rows the cell extends | `number` | `null` |
Expand property
| Property | Description | Type | Default |
| ------------------ | ------------------------------------- | ----------------------- | ------- |
| `[nzShowExpand]` | Whether show expand icon | `boolean` | - |
| `[nzExpand]` | Current expand status, double binding | `boolean` | - |
| `[nzExpandIcon]` | Custom expand icon | `TemplateRef` | - |
| `(nzExpandChange)` | Expand status change callback | `EventEmitter` | - |
Style property
| Property | Description | Type | Default |
| ----------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------- | ------- |
| `[nzLeft]` | Left pixels, used to fixed column to left, auto calc when set to `true` and disable fixed when `false` | `string \| boolean` | - |
| `[nzRight]` | Right pixels, used to fixed column to right, auto calc when set to `true` and disable fixed when `false` | `string \| boolean` | - |
| `[nzAlign]` | Specify how content is aligned | `'left' \| 'right' \| 'center'` | - |
| `[nzCellControl]` | Set the position of the column, which is the value of the `value` field in the `NzCustomColumn` type | `string` | - |
| `[nzBreakWord]` | Whether insert line breaks within words | `boolean` | `false` |
| `[nzEllipsis]` | ellipsis cell content, not working with sorter and filters for now. Only work when nzTableLayout was `fixed` | `boolean` | `false` |
Other property
| Property | Description | Type | Default |
| ---------------- | ---------------------------------- | -------- | ------- |
| `[nzIndentSize]` | Indent size in pixels of tree data | `number` | - |
### thead
| Property | Description | Type | Default |
| --------------------- | ------------------------------------------------------------ | --------------------------------------------------------------------- | ------- |
| `(nzSortOrderChange)` | sort change callback,should used with `nzColumnKey` of `th` | `EventEmitter<{ key: string, value: 'descend' \| 'ascend' \| null }>` | - |
### tr
| Property | Description | Type | Default |
| ------------ | -------------------------------------------------------- | --------- | ------- |
| `[nzExpand]` | Whether expand current row,used with `nzExpand` of `td` | `boolean` | - |
### tfoot
| Property | Description | Type | Default |
| ------------- | ----------------------------------- | ------------------------------ | ------- |
| `[nzSummary]` | Summary content | `boolean` | - |
| `[nzFixed]` | Fixed summary, used with `nzScroll` | `boolean \| 'top' \| 'bottom'` | `false` |
### nz-filter-trigger
Customized filter panel
| Property | Description | Type | Default |
| ------------------- | ------------------------------------------------------------------------------------------------- | ------------------------- | ------- |
| `[nzDropdownMenu]` | Dropdown menu | `NzDropdownMenuComponent` | - |
| `[nzVisible]` | whether the dropdown menu is visible, double binding | `boolean` | - |
| `[nzActive]` | whether the icon status is activated | `boolean` | `false` |
| `[nzHasBackdrop]` | Whether or not attach a backdrop. | `boolean` | `false` |
| `(nzVisibleChange)` | a callback function takes an argument: `nzVisible`, is executed when the visible state is changed | `EventEmitter` | - |
### [nz-virtual-scroll]
virtual scroll directive work with `ng-template`, type: `TemplateRef<{ $implicit: T, index: number }>`.
## Note
In order to get better performance, all NG-ZORRO's components are running under [OnPush](https://angular.dev/guide/components/advanced-configuration#changedetectionstrategy) mode, this means any mutate to the `@Input()` data won't trigger change detection, please use immutable way to update array or object.
```typescript
// add data
this.dataSet = [
...this.dataSet,
{
key: `${this.i}`,
name: `Edward King ${this.i}`,
age: '32',
address: `London, Park Lane no. ${this.i}`
}
];
// remove data
this.dataSet = this.dataSet.filter(d => d.key !== i);
```
Recommend using [immer](https://immerjs.github.io/immer/docs/introduction) for a better development experience.
---
Title: Switch
URL: https://ng.ant.design/components/switch/en
---
## When To Use
- If you need to represent the switching between two states or on-off state.
- The difference between `Switch` and `Checkbox` is that `Switch` will trigger a state change directly when you toggle it, while `Checkbox` is generally used for state marking, which should work in conjunction with submit operation.
## API
### nz-switch
| Property | Description | Type | Default | Global Config |
| ----------------------- | ----------------------------------------------------------------------- | ----------------------------- | ----------- | ------------- |
| `[nzId]` | button id attribute inside the component | `string` | - |
| `[ngModel]` | determine whether the `nz-switch` is checked, double binding | `boolean` | `false` |
| `[nzCheckedChildren]` | content to be shown when the state is checked | `string \| TemplateRef` | - |
| `[nzUnCheckedChildren]` | content to be shown when the state is unchecked | `string \| TemplateRef` | - |
| `[nzDisabled]` | Disable switch | `boolean` | `false` |
| `[nzSize]` | the size of the `nz-switch`, options: `default` `small` | `'small' \| 'default'` | `'default'` | ✅ |
| `[nzLoading]` | loading state of switch | `boolean` | `false` |
| `[nzControl]` | determine whether fully control state by user | `boolean` | `false` |
| `(ngModelChange)` | a callback function, can be executed when the checked state is changing | `EventEmitter` | - |
#### Methods
| Name | Description |
| ------- | ------------ |
| focus() | get focus |
| blur() | remove focus |
---
Title: Steps
URL: https://ng.ant.design/components/steps/en
---
## When To Use
When a given task is complicated or has a certain sequence in the series of subtasks, we can decompose it into several steps to make things easier.
## API
```html
```
### nz-steps
The whole of the step bar.
| Property | Description | Type | Default |
|----------------------|---------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|--------------|
| `[nzType]` | type of steps, can be set to one of the following values: `default`, `navigation` | `'default' \| 'navigation'` | `default` |
| `[nzCurrent]` | To set the current step, counting from 0. You can overwrite this state by using `nzStatus` of `nz-step` | `number` | `0` |
| `[nzDirection]` | To specify the direction of the step bar, `horizontal` and `vertical` are currently supported | `'vertical' \| 'horizontal'` | `horizontal` |
| `[nzLabelPlacement]` | Support vertical title and description | `'vertical' \| 'horizontal'` | `horizontal` |
| `[nzProgressDot]` | Steps with progress dot style, customize the progress dot by setting it with TemplateRef | `boolean \| TemplateRef<{ $implicit: TemplateRef, status: string, index: number }>` | `false` |
| `[nzSize]` | To specify the size of the step bar, `default` and `small` are currently supported | `'small' \| 'default'` | `'default'` |
| `[nzStatus]` | To specify the status of current step, can be set to one of the following values: `wait` `process` `finish` `error` | `'wait' \| 'process' \| 'finish' \| 'error'` | `'process'` |
| `[nzStartIndex]` | To specify the starting number | `number` | `0` |
| `(nzIndexChange)` | Trigger event when step click | `number` | - |
### nz-step
A single step in the step bar.
| Property | Description | Type | Default |
|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|----------|
| `[nzDescription]` | description of the step, optional property | `string \| TemplateRef` | - |
| `[nzIcon]` | icon of the step, optional property | `string \| string[] \| Set \| { [klass: string]: any; }` \| `TemplateRef` | - |
| `[nzStatus]` | to specify the status. It will be automatically set by `nzCurrent` of `nz-steps` if not configured. Optional values are: `wait` `process` `finish` `error` | `'wait' \| 'process' \| 'finish' \| 'error'` | `'wait'` |
| `[nzTitle]` | title of the step | `string \| TemplateRef` | - |
| `[nzSubtitle]` | subTitle of the step | `string \| TemplateRef` | - |
| `[nzDisabled]` | disable click | `boolean` | `false` |
| `[nzPercentage]` | Progress percentage of the step in `process` status (only works on basic Steps) | `number` | - |
---
Title: Statistic
URL: https://ng.ant.design/components/statistic/en
---
## When To Use
- When want to highlight some data.
- When want to display statistic data with description.
## API
### nz-statistic
| Property | Description | Type | Default |
| ------------------- | ---------------------------------- | ---------------------------------------------- | ------- |
| `[nzPrefix]` | Prefix of Value | `string \| TemplateRef` | - |
| `[nzSuffix]` | Suffix of Value | `string \| TemplateRef` | - |
| `[nzTitle]` | Title | `string \| TemplateRef` | - |
| `[nzValue]` | Value | `string \| number` | - |
| `[nzValueStyle]` | Value CSS style | `Object` | - |
| `[nzValueTemplate]` | Custom template to render a number | `TemplateRef<{ $implicit: string \| number }>` | - |
| `[nzLoading]` | Loading status of Statistic | `boolean` | `false` |
### nz-countdown
| Property | Description | Type | Default |
| --------------------- | -------------------------------- | ------------------------------------ | ------------ |
| `[nzFormat]` | Format string | `string` | `"HH:mm:ss"` |
| `[nzPrefix]` | Prefix of Value | `string \| TemplateRef` | - |
| `[nzSuffix]` | Suffix of Value | `string \| TemplateRef` | - |
| `[nzTitle]` | Title | `string \| TemplateRef` | - |
| `[nzValue]` | Target time in timestamp form | `string \| number` | - |
| `[nzValueTemplate]` | Custom template to render a time | `TemplateRef<{ $implicit: number }>` | - |
| `(nzCountdownFinish)` | Emit when countdown finishes | `void` | - |
### nzFormat
| Token | Description |
| ----- | ----------- |
| `Y` | Year |
| `M` | Month |
| `D` | Date |
| `H` | Hour |
| `m` | Minute |
| `s` | Second |
| `S` | Millisecond |
---
Title: Splitter
URL: https://ng.ant.design/components/splitter/en
---
## When To Use
The Splitter component can be used to separate areas horizontally or vertically.
You can freely drag the splitter to adjust the size of each side, while also being able to specify its minimum and
maximum width and height.
## API
### nz-splitter
| Property | Description | Type | Default |
|-------------------|---------------------------------|------------------------------|----------------|
| `[nzLayout]` | Layout direction | `'horizontal' \| 'vertical'` | `'horizontal'` |
| `[nzLazy]` | Lazy Mode | `boolean` | `false` |
| `(nzResizeStart)` | Callback before dragging starts | `EventEmitter` | - |
| `(nzResize)` | Panel size change callback | `EventEmitter` | - |
| `(nzResizeEnd)` | Drag end callback | `EventEmitter` | - |
### nz-splitter-panel
| Property | Description | Type | Default |
|-------------------|-----------------------------------------------------------------|--------------------------------------------------|---------|
| `[nzDefaultSize]` | Initial panel size support number for px or 'percent%' usage | `number \| string` | - |
| `[nzMin]` | Minimum threshold support number for px or 'percent%' usage | `number \| string` | - |
| `[nzMax]` | Maximum threshold support number for px or 'percent%' usage | `number \| string` | - |
| `[nzSize]` | Controlled panel size support number for px or 'percent%' usage | `number \| string` | - |
| `[nzCollapsible]` | Quick folding | `boolean \| { start?: boolean; end?: boolean }` | `false` |
| `[nzResizable]` | Whether to enable drag and drop | `boolean` | `true` |
---
Title: Spin
URL: https://ng.ant.design/components/spin/en
---
## When To Use
When part of the page is waiting for asynchronous data or during a rendering process, an appropriate loading animation can effectively alleviate users' inquietude.
## API
### nz-spin
| Property | Description | Type | Default Value | Global Config |
| --------------- | --------------------------------------------------------------------------------------- | --------------------------------- | ------------- | ------------- |
| `[nzDelay]` | specifies a delay in milliseconds for loading state (prevent flush), unit: milliseconds | `number` | - |
| `[nzIndicator]` | the spinning indicator | `TemplateRef` | - | ✅ |
| `[nzSize]` | size of Spin | `'large' \| 'small' \| 'default'` | `'default'` |
| `[nzSpinning]` | whether Spin is spinning | `boolean` | `true` |
| `[nzSimple]` | whether Spin has no children | `boolean` | `false` |
| `[nzTip]` | customize description content when Spin has children | `string` | - |
---
Title: Space
URL: https://ng.ant.design/components/space/en
---
## When To Use
- Avoid components clinging together and set a unified space.
- Use `` when child form components are compactly connected and the border is collapsed.
The difference with Flex component is:
- Space is used to set the spacing between inline elements. It will add a wrapper element for each child element for inline alignment. Suitable for equidistant arrangement of multiple child elements in rows and columns.
- Flex is used to set the layout of block-level elements. It does not add a wrapper element. Suitable for layout of child elements in vertical or horizontal direction, and provides more flexibility and control.
## API
### nz-space
| Property | Description | Type | Default | Global Config |
| --------------- | ------------------------------------------- | -------------------------------------------- | ------------ | ------------- |
| `[nzSize]` | The space size | `NzSpaceSize \| NzSpaceSize[]` | `small` | ✅ |
| `[nzDirection]` | The space direction | `'vertical' \| 'horizontal'` | `horizontal` | |
| `[nzAlign]` | Align items | `'start' \| 'end' \| 'baseline' \| 'center'` | - | |
| `[nzWrap]` | Auto wrap line, when `horizontal` effective | `boolean` | `false` | |
| `[nzSplit]` | Set split | `TemplateRef \| string` | - | |
#### Interfaces
```ts
type NzSpaceSize = 'small' | 'middle' | 'large' | number;
```
### nz-space-compact
Use `` when child form components are compactly connected and the border is collapsed. The supported components are:
- Button
- Cascader
- DatePicker
- Input
- Select
- TimePicker
- TreeSelect
| 参数 | 说明 | 类型 | 默认值 | 支持全局配置 |
| --------------- | ------------------------------------------ | --------------------------------- | -------------- | ------------ |
| `[nzBlock]` | Option to fit width to its parent\'s width | `boolean` | `false` | |
| `[nzDirection]` | Set direction of layout | `'vertical' \| 'horizontal'` | `'horizontal'` | |
| `[nzSize]` | Set child component size | `'large' \| 'default' \| 'small'` | `'default'` | |
---
Title: Slider
URL: https://ng.ant.design/components/slider/en
---
## When To Use
To input a value in a range.
## API
### nz-slider
| Property | Description | Type | Default |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | ---------------------------------------------------------------------------- |
| `[nzDisabled]` | If true, the slider will not be interactable. | `boolean` | `false` |
| `[nzDots]` | Whether the thumb can drag over tick only. | `boolean` | `false` |
| `[nzIncluded]` | Make effect when `marks` not null,`true` means containment and `false` means coordinative | `boolean` | `true` |
| `[nzMarks]` | Tick mark of Slider, type of key must be `number`, and must in closed interval `[min, max]` ,each mark can declare its own style. | `object` | { number: string/HTML } or { number: { style: object, label: string/HTML } } |
| `[nzMax]` | The maximum value the slider can slide to | `number` | `100` |
| `[nzMin]` | The minimum value the slider can slide to. | `number` | `0` |
| `[nzRange]` | dual thumb mode | `boolean` | `false` |
| `[nzStep]` | The granularity the slider can step through values. Must greater than 0, and be divided by (max - min) . When `marks` no null, `step` can be `null`. | `number \| null` | `1` |
| `[nzTipFormatter]` | Slider will pass its value to `tipFormatter`, and display its value in Tooltip, and hide Tooltip when return value is null. | `(value: number) => string \| TemplateRef` | - |
| `[ngModel]` | The value of slider. When `range` is `false`, use `number`, otherwise, use `[number, number]` | `number \| number[]` | - |
| `[nzVertical]` | If true, the slider will be vertical. | `boolean` | `false` |
| `[nzReverse]` | Reverse the component | `boolean` | `false` |
| `[nzTooltipVisible]` | When set to `always` tooltips are always displayed. When set to `never` they are never displayed | `'default' \| 'always' \| 'never'` | `default` |
| `[nzTooltipPlacement]` | Set the default placement of Tooltip | `string` | |
| `(nzOnAfterChange)` | Fire when `onmouseup` is fired. | `EventEmitter` | - |
| `(ngModelChange)` | Callback function that is fired when the user changes the slider's value. | `EventEmitter` | - |
---
Title: Skeleton
URL: https://ng.ant.design/components/skeleton/en
---
## When To Use
- When resource needs long time loading, like low network speed.
- The component contains information, such as a List or Card.
- Only works when loading data for the first time.
- Could be replaced by Spin in any situation but can provide a better user experience.
## API
### nz-skeleton
| Property | Description | Type | Default |
| --------------- | --------------------------------------------------- | -------------------------------- | ------- |
| `[nzActive]` | Show animation effect | `boolean` | `false` |
| `[nzAvatar]` | Show avatar placeholder | `boolean \| NzSkeletonAvatar` | `false` |
| `[nzLoading]` | Display the skeleton when `true` | `boolean` | - |
| `[nzParagraph]` | Show the paragraph placeholder | `boolean \| NzSkeletonParagraph` | `true` |
| `[nzTitle]` | Show the title placeholder | `boolean \| NzSkeletonTitle` | `true` |
| `[nzRound]` | Show the paragraph and the title radius when `true` | `boolean` | `false` |
### NzSkeletonAvatar
| Property | Description | Type | Default |
| -------- | -------------------- | ------------------------------------------- | ------- |
| `size` | Set the avatar size | `number \| 'large' \| 'small' \| 'default'` | - |
| `shape` | Set the avatar shape | `'circle' \| 'square'` | - |
### NzSkeletonTitle
| Property | Description | Type | Default |
| -------- | ------------------- | ------------------ | ------- |
| `width` | Set the title width | `number \| string` | - |
### NzSkeletonParagraph
| Property | Description | Type | Default |
| -------- | -------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- | ------- |
| `rows` | Set the row count of the paragraph | `number` | - |
| `width` | Set the width of the paragraph. When width is an Array, it can set the width of each row. Otherwise, only set the last row width | `number \| string \| Array` | - |
### nz-skeleton-element [nzType="button"]
| Property | Description | Type | Default |
| ------------ | --------------------- | ---------------------------------------------- | ----------- |
| `[nzActive]` | Show animation effect | `boolean` | `false` |
| `[nzSize]` | Set the size | `'large' \| 'small' \| 'default'` | `'default'` |
| `[nzShape]` | Set the shape | `'square' \| 'circle' \| 'round' \| 'default'` | `'default'` |
### nz-skeleton-element [nzType="avatar"]
| Property | Description | Type | Default |
| ------------ | --------------------- | ------------------------------------------- | ----------- |
| `[nzActive]` | Show animation effect | `boolean` | `false` |
| `[nzSize]` | Set the size | `number \| 'large' \| 'small' \| 'default'` | `'default'` |
| `[nzShape]` | Set the shape | `'circle' \| 'square'` | `'square'` |
### nz-skeleton-element [nzType="input"]
| Property | Description | Type | Default |
| ------------ | --------------------- | --------------------------------- | ----------- |
| `[nzActive]` | Show animation effect | `boolean` | `false` |
| `[nzSize]` | Set the size | `'large' \| 'small' \| 'default'` | `'default'` |
### nz-skeleton-element [nzType="image"]
| Property | Description | Type | Default |
| ------------ | --------------------- | --------- | ------- |
| `[nzActive]` | Show animation effect | `boolean` | `false` |
---
Title: Select
URL: https://ng.ant.design/components/select/en
---
## When To Use
- A dropdown menu for displaying choices - an elegant alternative to the native `