├── .gitignore ├── .npmignore ├── .nvmrc ├── .travis.yml ├── LICENSE ├── README.md ├── __tests__ ├── __snapshots__ │ └── index.tsx.snap └── index.tsx ├── example ├── app.tsx ├── assets │ └── .gitkeep ├── cat.gif ├── index.html ├── index.tsx ├── styled.ts └── utils.ts ├── package.json ├── src ├── Bar.tsx ├── Container.tsx ├── DragEngine.ts ├── StrollCaptor.tsx ├── StrollableContainer.tsx ├── Stroller.tsx ├── context.tsx ├── index.ts ├── types.ts └── utils.ts ├── tsconfig.json └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | /dist/ 3 | .DS_Store 4 | coverage/ -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | npm-debug.log 3 | .DS_Store 4 | example 5 | __tests__ -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 8.5.0 -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '10' 4 | cache: yarn 5 | script: 6 | - yarn 7 | - yarn test:ci 8 | notifications: 9 | email: false -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Anton 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 |

React-Sctroller 📜🏃‍

3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | ----- 17 | The right page scroller - browser friendly custom draggable scrollbars. 18 | [Demo](https://codesandbox.io/s/mm5xq5kv5y) 19 | 20 | # Capabilities 21 | 22 | - ⛓display any custom scroll bar, even, well, [nyan-cat](https://github.com/theKashey/react-nyan-stroller)🐈🏳️‍🌈🏳️‍🌈🏳️‍🌈 scroll bar 23 | - 📜 vertical and horizontal, as well as not matching main scroll axis - like displaying horizontal "reading indicator" for the vertical scroll. 24 | - 👨‍🔬display scrollbar 1) inside 2) outside 3) at window the target scrollable 25 | - 🤓support for "ScrollIndicators", and actually any other "custom" 🤹‍♀️ effects 26 | - 🚀support for passive scroll observation (🥳 performance) 27 | - 🧸easy to use out of the box/fully customizable. 28 | 29 | # API 30 | Stroller provides 4 components - to create Scrollable `container`, to draw a `scroll bar` and 31 | to `combine` all together. The 4th component is a magic one - `StrollCaptor`. 32 | 33 | Written in TypeScript. IDE should provide 100% prop competition. 34 | 35 | Provides friction-less expirience, as long stroller does not hook into `onwheel` event, 36 | observing browser scroll silently, keeping all animations smooth. 37 | 38 | Could be used inside and outside scrollable node, autodetecting nearest scrollable parent. 39 | 40 | ```js 41 | import {StrollableContainer} from 'react-stroller'; 42 | 43 | 44 | 45 |