Open In App

Angular PrimeNG Panel Properties

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 the different properties of the Panel component in Angular PrimeNG. 

Panel Component allows us to make an element containing a header and some content associated with that header.



Panel Properties:

 



Creating Angular application & module installation:

Step 1: To create an angular app, you need to install the angular command line interface through the npm command.

npm install -g angular-cli

Step 2: Now we will create an angular project.

ng new project_name

Step 3: After creating your angular project, move into the folder to perform different operations.

cd project_name

Step 4: After creating the Angular application, Install the required module using the following command:

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

Project Structure: After running the commands mentioned in the above steps, it will look like the following:

Project Structure

Step to Run Application: Run the application using the following command from the root directory of the project:

ng serve --open

Example 1: We are creating a UI that shows Angular PrimeNG Panel Properties.




<div style="margin:100px;">
    <h1 style="color: green;">GeeksforGeeks</h1>
    <h3>Angular PrimeNG Panel Properties</h3>
    <p-panel header="DSA Self Paced Course" 
        [toggleable]="true" [collapsed]="true" 
        collapseIcon="pi pi-angle-double-up"
        expandIcon="pi pi-angle-double-down">
        <p>
            Most popular course on DSA trusted by 
            over 75,000 students! Built with years 
            of experience by industry experts and 
            gives you a complete package of video 
            lectures, practice problems, quizzes, 
            discussion forums and contests. Start 
            Today!
        </p>
    </p-panel>
</div>




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

Output:

 

Example 2: We are creating a UI that shows above mentioned Properties of Panel.




<div style="margin:100px;">
    <h1 style="color: green;">GeeksforGeeks</h1>
    <h3>Angular PrimeNG Panel Properties</h3>
    <p-panel header="Hi Geek!" [toggleable]="true" 
        [collapsed]="true" collapseIcon="pi pi-angle-double-up"
        expandIcon="pi pi-angle-double-down" iconPos="center">
        <p>
            Welcome to Geeks For Geeks!<br />Billions of Users, 
            Millions of Articles Published, Thousands Got Hired 
            by Top Companies and the numbers are still growing.
        </p>
    </p-panel>
</div>




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

Output:

 

Reference: https://primefaces.org/primeng/panel


Article Tags :