Angular PrimeNG ScrollPanel Styling
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. This article will show us how to use ScrollPanel Styling in Angular PrimeNG.
The ScrollPanel Component is a lightweight, cross-browser replacement to the built-in browser scrollbar. This article will show ScrollPanel Styling in Angular PrimeNG. The ScrollPanel styling allows us to customize the default styling of the ScrollPanel using the classes so that we can create a custom design. ScrollPanel styling is discussed below:
Angular PrimeNG ScrollPanel Styling:
- p-scrollpanel: It is the container element.
- p-scrollpanel-wrapper: It is the wrapper of the content section.
- p-scrollpanel-content: It is the content section.
- p-scrollpanel-bar: It is the scrollbar handle.
- p-scrollpanel-bar-x: It is for the handling of a horizontal bar scrollbar.
- p-scrollpanel-bar-y: It is for the handling of a vertical bar scrollbar.
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 that illustrates the use of the Angular PrimeNG ScrollPanel Styling using only vertical scrolling.
HTML
<h1 style="color: green">GeeksforGeeks</h1>
<h5>Angular PrimeNG ScrollPanel Styling</h5>
<p-scrollPanel>
<p>
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
</p>
</p-scrollPanel>
JavaScript
import { Component, OnInit, ViewEncapsulation}
from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
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 { ScrollPanelModule } from 'primeng/scrollpanel';
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
ScrollPanelModule
],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
CSS
:host ::ng-deep .p-scrollpanel {
padding: 1.5rem;
line-height: 2;
border: 5px solid green !important;
box-shadow: 5px 10px #eb5454;
height: 250px !important;
}
Output:
Example 2: Below is the example that illustrates the use of the Angular PrimeNG ScrollPanel Styling using horizontal scrolling.
HTML
<h1 style="color: green">GeeksforGeeks</h1>
<h5>Angular PrimeNG ScrollPanel Styling</h5>
<p-scrollPanel>
<p>
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
It is a Computer Science Portal for all the geeks.
GeeksforGeeks,
</p>
</p-scrollPanel>
JavaScript
import { Component, OnInit, ViewEncapsulation}
from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
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 { ScrollPanelModule } from 'primeng/scrollpanel';
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
ScrollPanelModule
],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
CSS
:host ::ng-deep .p-scrollpanel {
p {
padding: 1.5rem;
line-height: 2;
border: 5px solid green !important;
box-shadow: 5px 10px #eb5454;
width: 1000px;
}
}
Output:
Reference: https://primefaces.org/primeng/scrollpanel
Similar Reads
Angular PrimeNG ScrollTop Styling
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.
5 min read
Angular PrimeNG ScrollPanel Templates
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 Angular PrimeNG ScrollPanel Templates. The ScrollPanel Componen
3 min read
Angular PrimeNG Ripple Styling
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 see Angular PrimeNG Ripple Styling. The Ripple Component is used to apply a ripple effect an
3 min read
Angular PrimeNG Splitter Styling
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 Angular PrimeNG Splitter Styling. The Splitter Component allows a u
3 min read
Angular PrimeNG Skeleton Styling
Angular Prime NG 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 how to use Skeleton Component Styling in Angular Prime NG. The Skeleton comp
3 min read
Angular PrimeNG Steps Styling
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 Angular PrimeNG Steps Styling. The Steps Component guides users th
3 min read
Angular PrimeNG Table Scrolling
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 Table Scrolling in Angular PrimeNG. Angular PrimeNG Table Scrol
5 min read
Angular PrimeNG Sidebar Styling
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 Sidebar component in Angular PrimeNG. The Sidebar compon
3 min read
Angular PrimeNG TabView Scrollable
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 TabView Scrollable in Angular PrimeNG. We will also lea
3 min read
Angular PrimeNG ScrollTop Window
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 ScrollTop Window in Angular PrimeNG. The ScrollTop Component is displayed after the user has scrolled up to a
3 min read