PrimeNG is a free and open source library of UI components. It is developed by PrimeTek Informatics. PrimeNG provides 80+ UI components in a single library, so there would be no need to add any other library for different UIs. It includes all UI components like Datatable, Breadcrumbs, Input, Accordion, Notification message box, Multimedia, and Menu etc.

Note
Make sure that you have Node.js installed. If not, then install the latest version of Node.js by Downloading Node.js from Node.js website.

npm -v
Step 1
ng new PrimeUIDemo

Step 2
Open the Terminal by going to View >terminal or by pressing Ctrl + ~.
- npm install primeng --save
- npm install primeicons --save
- npm install --save @angular/animations
- import { BrowserModule } from '@angular/platform-browser';
- import { NgModule } from '@angular/core';
- import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
- import { AppRoutingModule } from './app-routing.module';
- import { AppComponent } from './app.component';
- import { AccordionModule } from 'primeng/components/accordion/accordion';
- import {OrderListModule} from 'primeng/orderlist';
- @NgModule({
- declarations: [
- AppComponent
- ],
- imports: [
- BrowserModule,
- AppRoutingModule,BrowserAnimationsModule,AccordionModule,OrderListModule
- ],
- providers: [],
- bootstrap: [AppComponent]
- })
- export class AppModule { }
- <p-accordion>
- <p-accordionTab header="India">
- <p-orderList [value]="Indiastate">
- <ng-template let-state pTemplate="item">
- <div class="ui-helper-clearfix">
- <div style="font-size:16px;float:left;margin:5px">{{state}}</div>
- </div>
- </ng-template>
- </p-orderList>
- </p-accordionTab>
- <p-accordionTab header="Australia">
- <p-orderList [value]="Ausstate">
- <ng-template let-Ausstate pTemplate="item">
- <div class="ui-helper-clearfix">
- <div style="font-size:16px;float:left;margin:5px">{{Ausstate}}</div>
- </div>
- </ng-template>
- </p-orderList>
- </p-accordionTab>
- <p-accordionTab header="SriLanka">
- <p-orderList [value]="Slstate">
- <ng-template let-Slstate pTemplate="item">
- <div class="ui-helper-clearfix">
- <div style="font-size:16px;float:center;margin:5px">{{Slstate}}</div>
- </div>
- </ng-template>
- </p-orderList>
- </p-accordionTab>
- </p-accordion>
- import { Component } from '@angular/core';
- @Component({
- selector: 'app-root',
- templateUrl: './app.component.html',
- styleUrls: ['./app.component.css']
- })
- export class AppComponent {
- Indiastate = [
- "Rajasthan",
- "UP",
- "Mp",
- "Delhi",
- "Goa",
- "Gurjat",
- "Punjab"
- ];
- Ausstate = [
- "New South Wales",
- "Queensland",
- "South Australia",
- "Tasmania"
- ];
- Slstate = [
- "Kandy",
- "Galle",
- "Kegalle",
- "Mannar"
- ];
- }
Step 9


Join the conversation! Your thoughts help the community grow.