You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -45,66 +55,106 @@ class App extends Component {
45
55
}
46
56
```
47
57
48
-
**Important**: **You will always need to pass through the given props** for the respective element like in the example above: `<div {...props} className="track-horizontal"/>`.
49
-
This is because we need to pass some default `styles` down to the element in order to make the component work.
58
+
**Important**: **You will always need to pass through the given props** for the respective element like in the example above: `<div {...props} className="track-horizontal"/>`. This is because we need to pass some default `styles` down to the element in order to make the component work.
50
59
51
60
If you are working with **inline styles**, you could do something like this:
There's very little 'beautifying' styles applied by default, however if you'd like to change the `background-color` of the **thumbs** or `border-radius` of the **tracks** you can easily disable their default styling by passing a single prop `disableDefaultStyles`.
94
+
95
+
## Classes prop
96
+
97
+
You can pass `classes` prop and set your own className for every provided element
98
+
99
+
```jsx | pure
100
+
import { Scrollbars } from'rc-scrollbars';
101
+
importcssfrom'./styles.module.css';
102
+
103
+
constStyledScrollbars= ({ children }) => {
104
+
return (
105
+
<Scrollbars
106
+
classes={{
107
+
root:css.root,
108
+
view:css.view,
109
+
trackHorizontal:css.trackHorizontal,
110
+
thumbHorizontal:css.thumbHorizontal,
111
+
trackVertical:css.trackVertical,
112
+
thumbVertical:css.thumbVertical,
113
+
}}
114
+
>
115
+
{children}
116
+
</Scrollbars>
117
+
);
118
+
};
119
+
```
120
+
121
+
# Respond to scroll events
71
122
72
123
If you want to change the appearance in respond to the scrolling position, you could do that like:
0 commit comments