{"name":"overlayscrollbars-react","version":"0.2.2","description":"OverlayScrollbars wrapper for React.","keywords":["overlayscrollbars","react"],"homepage":"https://kingsora.github.io/OverlayScrollbars","repository":{"type":"git","url":"git+https://github.com/KingSora/OverlayScrollbars.git"},"bugs":{"url":"https://github.com/KingSora/OverlayScrollbars/issues"},"main":"./dist/overlayscrollbars-react.js","module":"./dist/overlayscrollbars-react.esm.js","typings":"./dist/types/index.d.ts","author":{"name":"KingSora | Rene Haas"},"license":"MIT","devDependencies":{"@types/overlayscrollbars":"^1.9.0","@types/react":"^16.9.27","chalk":"^2.4.2","gulp":"^4.0.2","gulp-json-editor":"^2.5.4","overlayscrollbars":"^1.11.0","react":"^16.13.1","rollup":"^1.32.1","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-typescript2":"^0.22.0","shelljs":"^0.8.3","typescript":"^3.8.3"},"peerDependencies":{"react":"^16.4.0","overlayscrollbars":"^1.10.0"},"scripts":{"setup":"npm i && cd example && npm i && cd ..","build":"node build.js","example":"cd example && npm start","build-example":"cd example && npm run build","test":"echo \"Error: no test specified\" && exit 1"},"_id":"overlayscrollbars-react@0.2.2","_npmVersion":"6.5.0","_nodeVersion":"10.16.0","_npmUser":{"name":"kingsora","email":"king-sora@hotmail.de"},"dist":{"integrity":"sha512-sRJDaKIxD+No6ygMRaCxejuIH2CksSCUTfaDOzDhPt22lI3IPZq/+Ifw2RT4j+U7hgXLn9P5QqA00f2bsZVwPA==","shasum":"330b5d298090d714af660ef45a73d89964f9172e","tarball":"http://registry-npm.ywwl.com/overlayscrollbars-react/download/overlayscrollbars-react-0.2.2.tgz","fileCount":11,"unpackedSize":34460,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeigTQCRA9TVsSAnZWagAAnScP/29cRA7GIp4XKTAOokbC\ndxDt0y8l22qz3RYbXYZDYqw8Yo1MFLRWVe6pDc0r2KbqAVXDAaDVnC5WWLOx\n/gnZ1i5EpMgf9r6tJn4SFDWvqjyS9DfYputbwIGWrd0niB7i4MnzNd0AklfP\n9eMHebaZyk18ZllA0HYVfwYSY53lfwI3NCOBfQxuDr24jAd61MtNQf6pqsA8\njKiOER/oy1mt4E+IjlyAkEr6zLjDL5fWRDUd70EghRcdokbecGvrRQbKzI7o\n3agBGvnUr1F1sokm4xTto/BZ4gx1zelM+WdsGVrrOu4N+t0JliSFEGjt/NF0\n2NvbBvW/fBlvWNKv+aYIMUfmxPqdXAb5gAHYt0dJ86thcl4y5EAd1Vi7Yn0V\nxOUXbQMael+EGbA9w00XHB5hEDUPZwJWdDSoXBEQ6DQYNu3cRtVIlzjtGgQu\nIiFMavm688i993zZrm4+lJZVjvplhrGg8110/bHhzROvQDzuMjUMrCN+flzz\nG9zrEzUsTCgrpGY5efb7O9ir+PR0eHrxnRzXkWoHYnW/vfZUuOPqKIdtVA9u\nJr8BXSBM42Flu90AjR9WqqpWTKxiLvnFe8tN6/7ohc3YzEwJ4vbUyA3XQiWU\nNgGslXlzl1YKCocKIA26rpTXywythOffWy06bM1feDv0eM/Kwa9YcsZPj/O9\nR48u\r\n=zd+w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHd1S7Q6aH3ZC9MGSi5NVEONk+wScUd4GRBVRm7plK6EAiEAm6CcQARpipx/u4Fr7u7KSWvGfviNLdPa0cgDTLsHmCI="}],"size":7506,"noattachment":false,"key":"/overlayscrollbars-react/-/overlayscrollbars-react-0.2.2.tgz"},"maintainers":[{"name":"kingsora","email":"king-sora@hotmail.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/overlayscrollbars-react_0.2.2_1586103503998_0.22114862642911093"},"_hasShrinkwrap":false,"readme":"<div align=\"center\">\n  <a href=\"https://kingsora.github.io/OverlayScrollbars\"><img src=\"https://raw.githubusercontent.com/KingSora/OverlayScrollbars/master/logo/logo.png\" width=\"160\" height=\"160\" alt=\"OverlayScrollbars\"></a>\n  <a href=\"https://reactjs.org\"><img src=\"https://raw.githubusercontent.com/KingSora/OverlayScrollbars/master/packages/overlayscrollbars-react/logo.svg\" width=\"160\" height=\"160\" alt=\"React\"></a>\n</div>\n<br />\n<div align=\"center\">\n\n  [![OverlayScrollbars](https://img.shields.io/badge/OverlayScrollbars-%5E2.0.0-338EFF?style=flat-square)](https://github.com/KingSora/OverlayScrollbars)\n  [![React](https://img.shields.io/badge/React-%3E=16.8.0-61DAFB?style=flat-square&logo=React)](https://github.com/facebook/react/)\n  [![Downloads](https://img.shields.io/npm/dt/overlayscrollbars-react.svg?style=flat-square)](https://www.npmjs.com/package/overlayscrollbars-react)\n  [![Version](https://img.shields.io/npm/v/overlayscrollbars-react.svg?style=flat-square)](https://www.npmjs.com/package/overlayscrollbars-react)\n  [![License](https://img.shields.io/github/license/kingsora/overlayscrollbars.svg?style=flat-square)](#)\n\n</div>\n<h3 align=\"center\">\n  <a href=\"https://kingsora.github.io/OverlayScrollbars\">Website</a>\n  &nbsp;&nbsp;&bull;&nbsp;&nbsp;\n  <a href=\"https://kingsora.github.io/OverlayScrollbars/examples\">Examples</a>\n</h3>\n\n# OverlayScrollbars for React\n\nThis is the official OverlayScrollbars React wrapper.\n\n## Installation\n\n```sh\nnpm install overlayscrollbars-react\n```\n\n## Peer Dependencies\n\nOverlayScrollbars for React has the following **peer dependencies**:\n\n- The vanilla JavaScript library: [overlayscrollbars](https://www.npmjs.com/package/overlayscrollbars)\n\n```\nnpm install overlayscrollbars\n```\n\n- The React framework: [react](https://www.npmjs.com/package/react)\n\n```\nnpm install react\n```\n\n## Usage\n\nThe first step is to import the CSS file into your app:\n```ts\nimport 'overlayscrollbars/overlayscrollbars.css';\n```\n\n> __Note__: If the path `'overlayscrollbars/overlayscrollbars.css'` is not working use `'overlayscrollbars/styles/overlayscrollbars.css'` as the import path for the CSS file.\n\n## Component\n\nThe main entry point is the `OverlayScrollbarsComponent` which can be used in your application as a component:\n\n```jsx\nimport { OverlayScrollbarsComponent } from \"overlayscrollbars-react\";\n\n// ...\n\n<OverlayScrollbarsComponent defer>\n  example content\n</OverlayScrollbarsComponent>\n```\n\n### Properties\n\nThe component accepts all properties of regular elements such as `div` and `span`.  \nAdditionally it has custom optional properties:\n\n- `element`: accepts a `string` which represents the tag of the root element.\n- `options`: accepts an `object` which represents the OverlayScrollbars options.\n- `events`: accepts an `object` which represents the OverlayScrollbars events.\n- `defer`: accepts an `boolean` or `object`. Defers the initialization to a point in time when the browser is idle.\n\n> __Note__: None of the properties has to be memoized.\n\n> __Note__: Its **highly recommended** to use the `defer` option whenever possible to defer the initialization to a browser's idle period.\n\n```jsx\n// example usage\n<OverlayScrollbarsComponent\n  element=\"span\"\n  options={{ scrollbars: { autoHide: 'scroll' } }}\n  events={{ scroll: () => { /* ... */ } }}\n  defer\n/>\n```\n\n### Ref\n\nThe `ref` of the `OverlayScrollbarsComponent` will give you an object with which you can access the OverlayScrollbars `instance` and the root `element` of the component.  \nThe ref object has two properties:\n\n- `osInstance`: a function which returns the OverlayScrollbars instance.\n- `getElement`: a function which returns the root element.\n\n## Hook\n\nIn case the `OverlayScrollbarsComponent` is not enough, you can also use the `useOverlayScrollbars` hook:\n\n```jsx\nimport { useOverlayScrollbars } from \"overlayscrollbars-react\";\n\n// example usage\nconst Component = () => {\n  const ref = useRef();\n  const [initialize, instance] = useOverlayScrollbars({ options, events, defer });\n  \n  useEffect(() => {\n    initialize(ref.current);\n  }, [initialize]);\n  \n  return <div ref={ref} />\n}\n```\n\nThe hook is for advanced usage and lets you control the whole initialization process. This is useful if you want to integrate it with other plugins such as `react-window` or `react-virtualized`.\n\nThe hook will destroy the instance automatically if the component unmounts.\n\n### Parameters\n\nParameters are optional and similar to the `OverlayScrollbarsComponent`.\nIts an `object` with optional properties:\n\n- `options`: accepts an `object` which represents the OverlayScrollbars options.\n- `events`: accepts an `object` which represents the OverlayScrollbars events.\n- `defer`: accepts an `boolean` or `object`. Defers the initialization to a point in time when the browser is idle.\n\n### Return\n\nThe `useOverlayScrollbars` hook returns a `tuple` with two values:\n\n- The first value is the `initialization` function, it takes one argument which is the `InitializationTarget`.\n- The second value is a function which returns the current OverlayScrollbars instance or `null` if not initialized.\n\n> __Note__: The identity of both functions is stable and won't change, thus they can safely be used in any dependency array.\n\n## License\n\nMIT\n","publish_time":1586103504139,"_cnpm_publish_time":1586103504139,"dist-tags":{"latest":"0.5.7"}}