Angular PrimeNG Divider Content
Last Updated :
26 Apr, 2025
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. This article will show us how to use the Divider component in Angular PrimeNG. We will also learn about the properties, along with their syntaxes that will be used in the code.
The Divider Component is used to make a component that divides the content using a divider. Any inner material is shown inside the divider's boundaries. Additionally, the align attribute controls where the material will appear. While "top," "center," and "bottom" are supported in vertical mode, "left," "center," and "right" are the alignment choices for horizontal layout.
Syntax:
<p>....</p>
<p-divider align="...">
...
</p-divider>
<p>...</p>
Angular PrimeNG Divider Content properties:
- align: It is used to set the alignment of the content. It is of string data type & the default value is null.
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. appname, 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: It will look like the following:
Steps to run the application: Run the below command to see the output.
ng serve --open
Example 1: This is the basic example code that illustrates the use of Angular PrimeNG Divider Content using left and center align.
HTML
<h1 style="color: green">GeeksforGeeks</h1>
<h5>Angular PrimeNG Divider Content</h5>
<p>
Angular PrimeNG is a framework used
with angular to create components with
great styling and this framework is
very easy to use and is used to make
responsive websites.
</p>
<p-divider align="left">
<i class="pi pi-user mr-1"></i>
<b>GeeksforGeeks</b>
</p-divider>
<p>
Angular PrimeNG is a framework used
with angular to create components with
great styling and this framework is
very easy to use and is used to make
responsive websites.
</p>
<p-divider align="center">
<span class="p-tag">GeeksforGeeks</span>
</p-divider>
<p>
Angular PrimeNG is a framework used
with angular to create components with
great styling and this framework is
very easy to use and is used to make
responsive websites.
</p>
JavaScript
import { Component } from "@angular/core";
@Component({
selector: "app-root",
templateUrl: "./app.component.html"
})
export class AppComponent {}
JavaScript
import { NgModule } from "@angular/core";
import { BrowserModule }
from "@angular/platform-browser";
import { BrowserAnimationsModule }
from "@angular/platform-browser/animations";
import { AppComponent } from "./app.component";
import { DividerModule } from "primeng/divider";
import { ButtonModule } from "primeng/button";
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
DividerModule,
ButtonModule
],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule {}
Output:
Example 2: This is another example code that illustrates the use of Angular PrimeNG Divider Content using left and center align.
HTML
<h1 style="color: green">GeeksforGeeks</h1>
<h5>Angular PrimeNG Divider Content</h5>
<p>
Angular PrimeNG is a framework used
with angular to create components with
great styling and this framework is
very easy to use and is used to make
responsive websites.
</p>
<p-divider align="right">
<p-button
label="Logout"
icon="pi pi-power-off"
styleClass="p-button-outlined">
</p-button>
</p-divider>
<p>
Angular PrimeNG is a framework used
with angular to create components with
great styling and this framework is
very easy to use and is used to make
responsive websites.
</p>
<p-divider align="center">
<span class="p-tag">GeeksforGeeks</span>
</p-divider>
<p>
Angular PrimeNG is a framework used
with angular to create components with
great styling and this framework is
very easy to use and is used to make
responsive websites.
</p>
JavaScript
import { Component } from "@angular/core";
@Component({
selector: "app-root",
templateUrl: "./app.component.html"
})
export class AppComponent {}
JavaScript
import { NgModule } from "@angular/core";
import { BrowserModule }
from "@angular/platform-browser";
import { BrowserAnimationsModule }
from "@angular/platform-browser/animations";
import { AppComponent } from "./app.component";
import { DividerModule } from "primeng/divider";
import { ButtonModule } from "primeng/button";
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
DividerModule,
ButtonModule
],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule {}
Output:
Reference: https://primefaces.org/primeng/divider
Similar Reads
Angular PrimeNG Divider 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 Divider component in Angular PrimeNG. We will also lear
5 min read
Angular PrimeNG Defer 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. It provides a lot of templates, components, theme design, an extensive icon library, and much more.
4 min read
Angular PrimeNG Divider Basic
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. This article will show us how to use the Angular PrimeNG Divider Basic. We will also learn about the
4 min read
Angular PrimeNG Divider Vertical with Content
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 Divider Vertical with Content in Angular PrimeNG. We wi
4 min read
Angular PrimeNG Dock 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. It provides a lot of templates, components, theme design, an extensive icon library, and much more.
4 min read
Angular PrimeNG Divider Border Style
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 Divider Border Style in Angular PrimeNG. We will also l
3 min read
ng-content in Angular
The ng-content is used when we want to insert the content dynamically inside the component that helps to increase component reusability. Using ng-content we can pass content inside the component selector and when angular parses that content that appears at the place of ng-content. Syntax:Â <ng-co
2 min read
Angular PrimeNG FilterService 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. It provides a lot of templates, components, theme design, an extensive icon library, and much more.
7 min read
Angular PrimeNG Pie Chart 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 see the Pie Chart Component in Angular PrimeNG. A Pie Chart is a circular s
3 min read
Angular Primeng MeterGroup Component
Angular PrimeNG is an open-source framework that comes with a large collection of native Angular UI components for amazing style. It makes creating responsive websites a breeze. Multiple metrics or progress indicators are often displayed as a series of progress bars using PrimeNG's MeterGroupModule.
3 min read