Basic example
Scrollbar is initialized automatically when you add
data-te-perfect-scrollbar-init
attribute to your container.

Hey there 👋 we want to make TW elements a community-driven project. It's open source and free, and we would like it to stay that way. If you enjoy it, help the project grow by sharing it with your peers. Every share counts, thank you!
Options
JavaScript init
You can easily init scrollbar with JavaScript. You have to invoke
PerfectScrollbar()
or te.PerfectScrollbar()
if you
are using UMD format and include options within that.

Data attributes
You can easily init scrollbar with options with
data-te-attributes
. You have to add
data-te-perfect-scrollbar-init
to your wrapper. If you want add
options with data-te-attr you have to add for example
data-te-suppress-scroll-x="true"
to your container.

Colors example
Scrollbar's thumb and rail's colors can be customized by changing the
default classes we add to them. Change the classes of the Scrollbar element
that you would like to edit: railXColors
,
railXThumbColors
, railYColors
or
railYThumbColors
. Visit the API section to see the default
classes for those elements.

Events
PerfectScrollbar dispatches custom events.
- ScrollX
- ScrollY
- ScrollUp
- ScrollDown
- ScrollLeft
- ScrollRight
- ScrollXEnd
- ScrollYEnd
- ScrollXStart
- ScrollYStart
Example
