Angular PrimeNG Properties for AvatarGroup
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. Avatars are used to denote letters, icons, and images in different shapes and background colors. This article will show us how to use the different properties of AvatarGroup in Angular PrimeNG.
The AvatarGroup Component is used to group avatars together. It creates a container for the avatars with the display property set to flex and items aligned to the center.
Syntax:
<p-avatarGroup [styleClass]="'test'">
<p-avatar
...
</p-avatar>
...
</p-avatarGroup>
Properties for AvatarGroup:
- style: Here, in this case also, is used to set the inline style of the component. It is of object data type, the default value is null.
- styleClass: Here, in this case also, is used to define the style class of the component. It is of string data type, the default value is null.
Approach: Let us create an Angular project and install the PrimeNG UI module. Then we will create a UI that will showcase Angular PrimeNG AvatarGroup Properties.
Creating React Project:
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 react 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, if you open the project in an editor you can see a similar project structure as shown below. The new component user makes or the code changes, we will be performing will be done in the source folder.

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: Below is the example code where we are creating a UI that shows the Inline Styling Property of Avatar Group.
HTML
< h2 style = "color: green" >GeeksforGeeks</ h2 >
< h3 >Angular PrimeNG Properties for AvatarGroup</ h3 >
< p-avatarGroup [style]="
{
'background-color':'black',
'color': 'green',
'width':'300px'
}">
< p-avatar
icon = "pi pi-hashtag" shape = "circle" size = "xlarge" >
</ p-avatar >
< p-avatar
label = "G" shape = "circle" size = "xlarge" >
</ p-avatar >
< p-avatar
label = "F" shape = "circle" size = "xlarge" >
</ p-avatar >
< p-avatar
label = "G" shape = "circle" size = "xlarge" >
</ p-avatar >
< p-avatar shape = "circle" size = "xlarge" image =
</ p-avatar >
</ p-avatarGroup >
|
Javascript
import { Component } from '@angular/core' ;
@Component({
selector: 'app-root' ,
templateUrl: './app.component.html' ,
styleUrls: [ './app.component.css' ]
})
export class AppComponent {}
|
Javascript
import { NgModule } from '@angular/core' ;
import { BrowserModule } from '@angular/platform-browser' ;
import { AvatarModule } from 'primeng/avatar' ;
import { AvatarGroupModule } from 'primeng/avatargroup' ;
import { AppComponent } from './app.component' ;
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AvatarModule,
AvatarGroupModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
|
Output:
Example 2: We are creating a UI that shows the External Styling (styleClass) Property of Avatar Group.
HTML
< h2 style = "color: green" >GeeksforGeeks</ h2 >
< h3 >Angular PrimeNG Properties for AvatarGroup</ h3 >
< p-avatarGroup [styleClass]="'test'">
< p-avatar
icon = "pi pi-hashtag" shape = "circle" size = "xlarge" >
</ p-avatar >
< p-avatar
label = "G" shape = "circle" size = "xlarge" >
</ p-avatar >
< p-avatar
label = "F" shape = "circle" size = "xlarge" >
</ p-avatar >
< p-avatar
label = "G" shape = "circle" size = "xlarge" >
</ p-avatar >
< p-avatar shape = "circle" size = "xlarge" image =
</ p-avatar >
</ p-avatarGroup >
|
Javascript
import { Component } from '@angular/core' ;
@Component({
selector: 'app-root' ,
templateUrl: './app.component.html' ,
styleUrls: [ './app.component.css' ]
})
export class AppComponent {}
|
Javascript
import { NgModule } from '@angular/core' ;
import { BrowserModule } from '@angular/platform-browser' ;
import { AvatarModule } from 'primeng/avatar' ;
import { AvatarGroupModule } from 'primeng/avatargroup' ;
import { AppComponent } from './app.component' ;
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AvatarModule,
AvatarGroupModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
|
CSS
::ng-deep .test {
background-color : grey;
color : green ;
width : 375px ;
}
|
Output:
Reference: https://primefaces.org/primeng/avatar
Similar Reads
Angular PrimeNG Properties of Avatar
Angular PrimeNG is an open-source library that consists 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 Angular PrimeNG Properties of Avatar. The Avatar Component is used to r
3 min read
Angular PrimeNG Styling of AvatarGroup
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 Styling of AvatarGroup. The AvatarGroup Component is used to group avatars together. T
3 min read
Angular PrimeNG AvatarGroup
Angular PrimeNG is a UI component library for Angular Applications. It offers many pre-built themes and UI components for a variety of tasks like inputs, menus, charts, Buttons, etc. In this article, we will be seeing Angular PrimeNG AvatarGroup. The AvatarGroup Component is used to group avatars to
2 min read
Angular PrimeNG Image Properties
Angular PrimeNG is an open-source UI component library for Angular Applications. Using the components provided by Angular PrimeNG, one can create stunning and responsive angular applications. In this article, we will see Angular PrimeNG Image Properties. The Image component is used to show a single
3 min read
Angular PrimeNG Badge Properties
Angular PrimeNG is an open-source library that consists 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 be seeing Angular PrimeNG Badge Properties. The Badge Component is used as an i
3 min read
Angular PrimeNG Chip Properties
Angular PrimeNG is a UI component catalog for angular applications. It consists of a wide range of UI components that help in making fast and scalable websites. In this article, we will see Chip Properties in Angular PrimeNG. The Chip Component represents entities using labels, icons, and images. Ch
3 min read
Angular PrimeNG Dock 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.
4 min read
Angular PrimeNG Menu Properties
Angular PrimeNG is an open-source library that consists 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 Menu Properties. The Menu component is used to navigate the
4 min read
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. P
4 min read
Angular PrimeNG ChartModel 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.
4 min read