-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
25 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,20 +20,17 @@ npm i react-custom-scroll --save | |
- Scrollbar is above the content instead of floating to the side - same layout on scrolled content as not scrolled content | ||
|
||
### How to use ? | ||
Custom scroll component is available in commonJS format so you can just require it after installing. | ||
There is also a UMD version - inside dist directory. | ||
In both cases **you have to include the customScroll.css** file in your page. | ||
Custom scroll component is available in module or commonJS format. | ||
It is located in /dist directory | ||
**From unpkg cdn:** | ||
* [Js file](https://unpkg.com/[email protected]/dist/reactCustomScroll) | ||
* [css file](https://unpkg.com/[email protected]/dist/customScroll.css) | ||
|
||
Wrap your content with the custom scroll component | ||
Remove any overflow style properties from your content root component - The custom scroll will take care of it | ||
|
||
|
||
```js | ||
import CustomScroll from 'react-custom-scroll'; | ||
import { CustomScroll } from "react-custom-scroll"; | ||
``` | ||
|
||
```jsx | ||
|
@@ -48,7 +45,7 @@ Your own custom design can be applied by styling these 2 classes in your css: | |
- rcs-custom-scrollbar - this class styles the container of the scroll handle, you can use it if your handle width is greater than the default. | ||
- rcs-inner-handle - this class styles the handle itself, you can use it to change the color, background, border and such of the handle | ||
|
||
You can see a usage example in example/firstComp/firstComp.scss | ||
You can see a usage example in the demo page. | ||
|
||
### Options (react props) | ||
|
||
|
@@ -65,6 +62,7 @@ This prop will override any value given to heightRelativeToParent when setting t | |
- **scrollTo**: number, default undefined. Will scroll content to the given value. | ||
- **keepAtBottom**: boolean, default false. For dynamic content, will keep the scroll position at the bottom of the content, when the content changes, if the position was at the bottom before the change. [See example here](http://rommguy.github.io/react-custom-scroll/exampleDist/index.html#dynamic-content-example) | ||
- **className**: string, default undefined. Allows adding your own class name to the root element. | ||
- **handleClass**: string. Can be used to replace the className given to the scroll handle, which is 'rcs-inner-handle' by default. | ||
|
||
##### Example for heightRelativeToParent | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
exampleDist/assets/index-IemJL0za.js → exampleDist/assets/index-7LHltgpN.js
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters