react-infinite-scroll-component icon indicating copy to clipboard operation
react-infinite-scroll-component copied to clipboard

How to style the scrollbar

Open siminn-bjorks opened this issue 3 years ago • 4 comments

Hi, i'm having trouble trying to style the scrollbar. I have tried styling it with webkit in the style props but it does not work. Any ideas on how to do this?

Thank you.

siminn-bjorks avatar Dec 28 '21 10:12 siminn-bjorks

You can add in CSS file .., work for me And you can change CSS style as per your requirements

.infinite-scroll-component { background-color: #ffff; scrollbar-color: rgba(0, 0, 0, 0.2) #ffff; scrollbar-face-color:rgba(0, 0, 0, 0.2); } .infinite-scroll-component::-webkit-scrollbar { width: 7px!important; } /* Track / .infinite-scroll-component::-webkit-scrollbar-track { background: rgb(255, 255, 255); } / Handle / .infinite-scroll-component::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.2); border-radius: 10px; } / Handle on hover */ .infinite-scroll-component::-webkit-scrollbar-thumb:hover { background:rgba(0, 0, 0, 0.2); }

Screenshot from 2022-01-12 15-08-32

Smitgamit avatar Jan 12 '22 09:01 Smitgamit

Hi, i'm having trouble trying to style the scrollbar. I have tried styling it with webkit in the style props but it does not work. Any ideas on how to do this?

Thank you.

Please follow the upper snippet

Smitgamit avatar Jan 13 '22 06:01 Smitgamit

Thank you! it works :)

siminn-bjorks avatar Jan 13 '22 14:01 siminn-bjorks

I am using SCSS style files and I am trying to style the scroll bar too but, with no success... JS:

  <div id="scrollableFeed" className={clsx(styles.root)}>
      <InfiniteScroll
        // code....
   </InfiniteScroll>
    </div>

SCSS:

.infinite-scroll-component {
background-color: #ffff;
scrollbar-color: rgba(0, 0, 0, 0.2) #ffff;
scrollbar-face-color:rgba(0, 0, 0, 0.2);
}
.infinite-scroll-component::-webkit-scrollbar {
width: 7px!important;
}

Thank you.

roee030 avatar Jul 07 '22 06:07 roee030