Open In App

Angular PrimeNG ProgressSpinner Component

Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will know how to use the ProgressSpinner component in Angular PrimeNG. We will also learn about the properties, styling along with their syntaxes that will be used in the code. 

ProgressSpinner: This component is used to make a spinner that illustrates the process status.



Properties:

Styling:



 

Creating Angular application & module  installation:

Step 1: Create an Angular application using the following command.

ng new appname

Step 2: After creating your project folder i.e. app name, move to it using the following command.

cd appname

Step 3: Install PrimeNG in your given directory.

npm install primeng --save
npm install primeicons --save

Project Structure: After complete installation, it will look like the following:

 

Example 1: This is the basic example that shows how to use the ProgressSpinner component.




<h2>GeeksforGeeks</h2>
<h5>PrimeNg ProgressSpinner Component</h5>
<p-progressSpinner></p-progressSpinner>




import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { BrowserAnimationsModule } 
    from '@angular/platform-browser/animations';
  
import { AppComponent } from './app.component';
import { ProgressSpinnerModule } 
    from 'primeng/progressspinner';
  
@NgModule({
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    ProgressSpinnerModule,
    FormsModule
  ],
  declarations: [AppComponent],
  bootstrap: [AppComponent]
})
export class AppModule {}




import { Component } from '@angular/core';
  
@Component({
  selector: 'my-app',
  templateUrl: './app.component.html'
})
export class AppComponent {}

Output:

Example 2: In this example, we will use strokeWidth, fill and animationduration properties in the progressSpinner Component.




<h2>GeeksforGeeks</h2>
<h5>PrimeNG ProgressSpinner Component</h5>
<p-progressSpinner strokeWidth="5" fill="#03fc24" 
                   animationDuration="1s"></p-progressSpinner>




import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { BrowserAnimationsModule } 
    from '@angular/platform-browser/animations';
  
import { AppComponent } from './app.component';
import { ProgressSpinnerModule } from 'primeng/progressspinner';
  
@NgModule({
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    ProgressSpinnerModule,
    FormsModule
  ],
  declarations: [AppComponent],
  bootstrap: [AppComponent]
})
export class AppModule {}




import { Component } from '@angular/core';
  
@Component({
  selector: 'my-app',
  templateUrl: './app.component.html'
})
export class AppComponent {}

Output: 

Reference: https://primefaces.org/primeng/showcase/#/progressspinner


Article Tags :