Language: JavaScript
UI Framework
NG-ZORRO was created to bring Ant Design’s comprehensive UI component system to Angular developers. It ensures consistency in design and behavior while leveraging Angular’s reactive and modular architecture. The library is widely used in enterprise applications in China and globally for Angular projects.
NG-ZORRO is an Angular UI component library based on Ant Design. It provides a wide range of high-quality, accessible, and enterprise-ready UI components specifically for Angular applications.
npm install ng-zorro-antdyarn add ng-zorro-antdAngular >= 14, RxJS >= 7Install via npm/yarn and import required modules into your Angular application.NG-ZORRO provides Angular components for forms, navigation, data display, feedback, layout, and more. Each component is an Angular module that can be imported individually for optimized bundle sizes.
import { NzButtonModule } from 'ng-zorro-antd/button';
@NgModule({
imports: [NzButtonModule]
})
export class AppModule {}
<button nz-button nzType="primary">Primary Button</button>Imports the `NzButtonModule` and uses a primary Ant Design button in Angular.
import { NzInputModule } from 'ng-zorro-antd/input';
<ng-container>
<input nz-input placeholder="Enter text" />
</ng-container>Uses the NG-ZORRO input component for styled input fields.
import { NzModalService } from 'ng-zorro-antd/modal';
constructor(private modal: NzModalService) {}
showModal(): void {
this.modal.create({
nzTitle: 'Modal Title',
nzContent: 'This is the modal content',
nzFooter: null
});
}Creates and displays a modal dialog using NG-ZORRO’s modal service.
<nz-table #basicTable [nzBordered]="true" [nzData]="listOfData" [nzBordered]="true">
<thead>
<tr>
<th>Name</th>
<th>Age</th>
<th>Address</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td>{{data.name}}</td>
<td>{{data.age}}</td>
<td>{{data.address}}</td>
</tr>
</tbody>
</nz-table>Implements a basic data table using NG-ZORRO’s table component.
<form nz-form [formGroup]="validateForm">
<nz-form-item>
<nz-form-label [nzSpan]="4">Username</nz-form-label>
<nz-form-control [nzSpan]="8" nzErrorTip="Please input your username">
<input nz-input formControlName="userName" />
</nz-form-control>
</nz-form-item>
</form>Demonstrates a form with validation using NG-ZORRO’s form components.
Import only the modules you need to reduce bundle size.
Use Angular reactive forms for NG-ZORRO form components for better validation and control.
Leverage built-in themes and customizable style variables for consistent UI.
Enable animations using Angular’s BrowserAnimationsModule for full experience.
Follow accessibility guidelines, as NG-ZORRO components are designed to be accessible by default.