3.0.2 • Published 1 year ago

styled-scrollbar v3.0.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

styled-scrollbar

styled-scrollbar helps you make customized(color, width, ...) scrollbars in react projects!

Quick start

First, run this command in your react app:

npm install styled-scrollbar

for your app.

Then:

import { ScrollbarX } from "styled-scrollbar";

Horizontal scrollbar:

//parent element
<ScrollbarX h={3} w={95}>
  //element that is scrollable👇🏽
  <div>
    //...items in scrolled element
  </div>
</ScrollbarX>

Horizontal scrollbar

Vertical scrollbar:

<ScrollbarY w={4} h={300}>
  //element that is scrollable👇🏽
  <div>
    //...items in scrolled element
  </div>
</ScrollbarY>

Vertical scrollbar


components: | Scrollbar | component | | :----------- | :------------ | | Horizontal | ScrollbarX | | Vertical | ScrollbarY |


Component Props guide:


color Props: | Prop | default | data type | meaning|
| :------|:- | :------- | :------- | trackColor| #cecece#cecece | string | color of scrollbar background | | thumbColor | #555#555 | string | color of scrollbar thumb |

size Props: | Prop | data type | meaning | | :--- | :-------- | :-------------------- | | w | number | width of scrollbar | | h | number | height of scrollbar | | r | number | borderRadius of scrollbar |

typedefault widthdefault heightdefault bRadius
ScrollbarXprevEl width6px2px
ScrollbarY6pxprevEl height2px

New update 3.0.2 :

now in version 3.0.2 you can give style for wraper, track and thumb by passing their own styles that you like not only the colors and sizes!

Propdefaultdata typemeaning
thumbStyle{}objectstyles applid on thumb of scrollbar
trackStyle{}objectstyles applid on track of scrollbar
wraperStyle{}objectstyles applid on wraper of scrollbar and scolling element

example: -

  <ScrollbarY
      wraperStyle={{ display: 'flex', flexDirection: 'row-reverse' }}
      trackStyle={{ margin: '0 5px' }}
      >
      ...
  </ScrollbarY>
1.1.1

1 year ago

1.1.0

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.0.3

1 year ago

2.1.1

1 year ago

2.0.2

1 year ago

2.0.34

1 year ago

2.1.0

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago