{"id":13679328,"url":"https://github.com/yairEO/fakescroll","last_synced_at":"2025-04-29T18:32:01.786Z","repository":{"id":31026609,"uuid":"34585153","full_name":"yairEO/fakescroll","owner":"yairEO","description":"vanilla-js lightweight custom HTML scrollbar ","archived":false,"fork":false,"pushed_at":"2022-12-05T08:22:45.000Z","size":177,"stargazers_count":368,"open_issues_count":7,"forks_count":34,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-20T01:53:39.115Z","etag":null,"topics":["component","custom-scrollbar","reactjs","scrollbar"],"latest_commit_sha":null,"homepage":"http://yaireo.github.io/fakescroll","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yairEO.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-25T20:35:36.000Z","updated_at":"2025-04-13T04:19:41.000Z","dependencies_parsed_at":"2023-01-14T18:11:48.976Z","dependency_job_id":null,"html_url":"https://github.com/yairEO/fakescroll","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yairEO%2Ffakescroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yairEO%2Ffakescroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yairEO%2Ffakescroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yairEO%2Ffakescroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yairEO","download_url":"https://codeload.github.com/yairEO/fakescroll/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251560070,"owners_count":21609134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["component","custom-scrollbar","reactjs","scrollbar"],"created_at":"2024-08-02T13:01:04.334Z","updated_at":"2025-04-29T18:32:01.516Z","avatar_url":"https://github.com/yairEO.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","HTML"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003ca href='https://yaireo.github.io/fakescroll'\u003e\u003cimg src=\"/scroll.png\" width=\"40%\" /\u003e\u003c/a\u003e\n  \u003cbr\u003e\u003cbr\u003e\n  \u003ca href='https://yaireo.github.io/fakescroll'\u003eFakeScroll\u003c/a\u003e⚡\u003cem\u003elightweight\u003c/em\u003e custom-looking scrollbars\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href='https://www.npmjs.com/package/@yaireo/fakescroll'\u003e\n      \u003cimg src=\"https://img.shields.io/npm/v/@yaireo/fakescroll.svg\" /\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/bundlephobia/minzip/@yaireo/fakescroll\" /\u003e\n  \u003cimg src=\"https://img.shields.io/npm/dw/@yaireo/fakescroll\" /\u003e\n\u003c/p\u003e\n\n\n- 1.4KB gzipped (js)\n- 4.0KB minified (js)\n- 7.7KB unminified (js)\n- ~20+ KB avarage similar scripts (unminified)\n\n\u003e Currently only supports *vertical* scroll due to cultural norms\n\nWhile there is somewhat of a support for scrollbar customization [through CSS](https://atomiks.github.io/30-seconds-of-css/#custom-scrollbar), it is not fully supported\nin all browsers / older versions and the level of customization isn't flexible enough to allow creativity or certain special product needs.\n\n👉 Make sure to *import* `fakescroll.css`\n\n## Install ([CDN](jsdelivr.com/package/npm/@yaireo/fakescroll)):\n\n```bash\nnpm i @yaireo/fakescroll\n```\n\n## [React port](https://codesandbox.io/s/react-fakescroll-4rdel)\n\n```js\nimport FakeScroll from '@yaireo/fakescroll/react.fakescroll.js'\nimport '@yaireo/fakescroll/fakescroll.css'\n\nconst onFakeScrollChange = ({ scrollRatio }) =\u003e console.log(scrollRatio)\n\n\u003cFakeScroll className='foo' track='smooth' onChange={onFakeScrollChange}\u003e\n    ...\n\u003c/FakeScroll\u003e\n```\n\n## Example markup:\n```html\n\u003cdiv class=\"foo\"\u003e\n    ...\n    ...\n    ...\n\u003c/div\u003e\n```\n\n## Initialize custom scrollbar with callback:\n```js\nvar myScrollbar = document.querySelector('.foo').fakeScroll({\n    onChange: () =\u003e console.log( myScrollbar.scrollRatio )\n})\n```\n\nThe `onChange` also has a `scrollRatio` propery in its *argument*:\n\n```js\ndocument.querySelector('.foo--outside').fakeScroll({\n    onChange: ({ scrollRatio }) =\u003e console.log( scrollRatio )\n});\n```\n\n## The above markup will now become:\n```html\n\u003cdiv class=\"foo fakeScroll fakeScroll--hasBar\"\u003e\n    \u003cdiv class=\"fakeScroll__wrap\"\u003e\n        \u003cdiv class=\"fakeScroll__content\"\u003e\n            ...\n            ...\n            ...\n        \u003c/div\u003e\n    \u003c/div\u003e\n    \u003cdiv class=\"fakeScroll__bar\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n```\n## Browser support\n\nThe script probably won't work on IE without [Babel](https://babeljs.io/docs/en/babel-cli) \u0026 [ES2015 polyfills](https://github.com/paulmillr/es6-shim).\n\n### [DEMO PAGE](http://yaireo.github.io/fakescroll)\n\n## Settings\n\nName                | Type            | Default     | Info\n------------------- | ----------      | ----------- | --------------------------------------------------------------------------\nclassname           | String          | \"\"          | Class name which is added to the scrollbar Track element\ntrack               | Boolean/String  | false       | enable track events. use \"smooth\" for smooth \"jumping\"\nonChange            | Function        |             | Callback function whenever the scroll updates\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FyairEO%2Ffakescroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FyairEO%2Ffakescroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FyairEO%2Ffakescroll/lists"}