Angular PrimeNG Toolbar Properties
Last Updated :
28 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. In this article, we will learn how to use the Toolbar Properties in Angular PrimeNG.
The Toolbar Component is used to group buttons and other components.
Angular PrimeNG Toolbar Properties:
- style: It is the style of the component. It is of object data type, the default value is null.
- styleClass: It is the class of the component. 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: To run the above file, run the below command:
ng serve --save
Example 1: Below is the example code that illustrates the use of Angular PrimeNG Toolbar Properties.
HTML
<h1 style="color: green">GeeksforGeeks</h1>
<h5>Angular PrimeNG Toolbar Properties</h5>
<p-toolbar>
<div class="p-toolbar-group-left">
<p-button label="GfG Turorials"
icon="pi pi-book" styleClass="p-button-success">
</p-button>
<i class="p-toolbar-separator pi pi-code mr-2"></i>
<p-splitButton label="GfG Courses" [model]="gfg"
styleClass="p-button-warning">
</p-splitButton>
</div>
</p-toolbar>
JavaScript
import { Component} from '@angular/core';
import {MenuItem} from 'primeng/api';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
gfg: MenuItem[];
ngOnInit() {
this.gfg = [
{
label: 'Data Structure'
},
{
label: 'System Design'
},
{
label: 'SDE Test Series'
},
{
label: 'C++ STL'
}
];
}
}
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 { ToolbarModule } from 'primeng/toolbar';
import { ButtonModule } from 'primeng/button';
import { SplitButtonModule } from 'primeng/splitbutton';
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
ToolbarModule,
ButtonModule,
SplitButtonModule,
],
declarations: [AppComponent],
bootstrap: [AppComponent],
})
export class AppModule {}
Output:
Example 2: Below is another example code that illustrates the use of Angular PrimeNG Toolbar Properties using both the left and right toolbar groups.
HTML
<h1 style="color: green">GeeksforGeeks</h1>
<h5>Angular PrimeNG Toolbar Properties</h5>
<p-toolbar>
<div class="p-toolbar-group-left">
<p-button label="GfG Turorials" icon="pi pi-book"
styleClass="p-button-success">
</p-button>
<i class="p-toolbar-separator pi pi-code mr-2"></i>
<p-splitButton label="GfG Courses" [model]="gfg"
styleClass="p-button-warning">
</p-splitButton>
</div>
<div class="p-toolbar-group-right">
<p-button label="Sign In" icon="pi pi-sign-in"
style="margin-right: 5px">
</p-button>
<p-button label="Sign Out"
icon="pi pi-sign-out">
</p-button>
</div>
</p-toolbar>
JavaScript
import { Component} from '@angular/core';
import {MenuItem} from 'primeng/api';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
gfg: MenuItem[];
ngOnInit() {
this.gfg = [
{
label: 'Data Structure'
},
{
label: 'System Design'
},
{
label: 'SDE Test Series'
},
{
label: 'C++ STL'
}
];
}
}
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 { ToolbarModule } from 'primeng/toolbar';
import { ButtonModule } from 'primeng/button';
import { SplitButtonModule } from 'primeng/splitbutton';
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
ToolbarModule,
ButtonModule,
SplitButtonModule,
],
declarations: [AppComponent],
bootstrap: [AppComponent],
})
export class AppModule {}
Output:
Reference: https://primefaces.org/primeng/toolbar
Similar Reads
Angular PrimeNG Tooltip 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 see how to use the Tooltip properties along with code examples in Angular P
5 min read
Angular PrimeNG Tag 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 see Angular PrimeNG Tag Properties. A tag component is used to create tags
3 min read
Angular PrimeNG Tree 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. It provides a lot of templates, components, theme design, an extensive icon library, and much more.
6 min read
Angular PrimeNG Sidebar 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 learn how to use the Sidebar Properties in Angular PrimeNG. The Sidebar Com
5 min read
Angular PrimeNG Table 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. It provides a lot of templates, components, theme design, an extensive icon library, and much more.
12 min read
Angular PrimeNG Steps 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 learn how to use the Steps Properties in Angular PrimeNG. We will also lear
3 min read
Angular PrimeNG TabMenu 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 learn how to use TabMenu Properties in Angular PrimeNG. The TabMenu compone
3 min read
Angular PrimeNG Toolbar Templates Angular PrimeNG is a framework used with angular to create components with great styling this framework is very easy to use and is used to make responsive websites. In this article, we will know how to use the Toolbar Templates in Angular PrimeNG. The Toolbar Component is used to group buttons and o
3 min read
Angular PrimeNG Splitter 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 see how to use Splitter Properties in Angular PrimeNG. The Splitter Compone
4 min read
Angular PrimeNG Terminal Properties Angular PrimeNG is an open-source front-end UI library that has many native Angular UI components which help developers to build a fast and scalable web solution. In this article, we will be seeing Angular PrimeNG Terminal Properties. The Terminal Component is a text base UI provided by PrimeNG wher
3 min read