{"id":27282701,"url":"https://github.com/biubiukam/better-scrollbar","last_synced_at":"2025-04-11T18:16:07.072Z","repository":{"id":211263652,"uuid":"728152390","full_name":"biubiukam/better-scrollbar","owner":"biubiukam","description":"自定义滚动条、滚动容器、虚拟滚动","archived":false,"fork":false,"pushed_at":"2024-02-05T04:16:48.000Z","size":503,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T18:16:00.180Z","etag":null,"topics":["customizable","react","scroll","scrollbar","scrolling","scrollview"],"latest_commit_sha":null,"homepage":"https://kampiu.github.io/better-scrollbar/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/biubiukam.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-12-06T10:41:44.000Z","updated_at":"2024-12-13T02:28:06.000Z","dependencies_parsed_at":"2023-12-07T13:29:06.449Z","dependency_job_id":"4c59a848-8bff-4fe3-ad12-3bf327400d46","html_url":"https://github.com/biubiukam/better-scrollbar","commit_stats":null,"previous_names":["kampiu/better-scrollbar","biubiukam/better-scrollbar"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biubiukam%2Fbetter-scrollbar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biubiukam%2Fbetter-scrollbar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biubiukam%2Fbetter-scrollbar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biubiukam%2Fbetter-scrollbar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/biubiukam","download_url":"https://codeload.github.com/biubiukam/better-scrollbar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248456368,"owners_count":21106604,"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":["customizable","react","scroll","scrollbar","scrolling","scrollview"],"created_at":"2025-04-11T18:16:06.321Z","updated_at":"2025-04-11T18:16:07.056Z","avatar_url":"https://github.com/biubiukam.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# better-scrollbar\n\n![NPM License](https://img.shields.io/npm/l/better-scrollbar)\n![NPM Version](https://img.shields.io/npm/v/better-scrollbar)\n[![Coverage Status](https://coveralls.io/repos/github/kampiu/better-scrollbar/badge.svg?branch=master)](https://coveralls.io/github/kampiu/better-scrollbar?branch=master)\n\nHighly customizable, high-performance virtual list for big data rendering.\n\nFeel free to provide feedback if there are any issues, and promptly synchronize problem handling.\n\n## Installation\n```bash\nnpm install better-scrollbar --save\n```\n\n## Usage\n\n```javascript\nimport React, { Component } from \"react\"\nimport ScrollBar from \"better-scrollbar\"\nimport \"better-scrollbar/dist/BetterScrollbar.min.css\"\n\nclass App extends Component {\n  render() {\n    return (\n      \u003cScrollBar style={{ width: 500, height: 300 }}\u003e\n        \u003cp\u003eSome great content...\u003c/p\u003e\n      \u003c/ScrollBar\u003e\n    )\n  }\n}\n```\n\nThe `\u003cScrollBar\u003e` component is completely customizable. Check out the following code:\n\n```javascript\nimport React, { Component } from \"react\"\nimport ScrollBar from \"better-scrollbar\"\nimport \"better-scrollbar/dist/BetterScrollbar.min.css\"\n\nclass CustomScrollBar extends Component {\n  render() {\n    return (\n      \u003cScrollBar\n        width={this.props.width}\n        height={this.props.height}\n        onScroll={this.handleScroll}\n        onScrollStart={this.handleScrollStart}\n        onScrollEnd={this.handleScrollEnd}\n        renderView={this.renderView}\n        renderTrackHorizontal={this.renderTrackHorizontal}\n        renderTrackVertical={this.renderTrackVertical}\n        renderThumbHorizontal={this.renderThumbHorizontal}\n        renderThumbVertical={this.renderThumbVertical}\n        scrollBarHidden\n        scrollBarAutoHideTimeout={1000}\n        {...this.props}\n      /\u003e\n    )\n  }\n}\n```\n\n### If you are a tree level structure, you can use the following code:\n\n```tsx\nimport React from \"react\"\nimport ScrollBar from \"better-scrollbar\"\nimport \"better-scrollbar/dist/BetterScrollbar.min.css\"\n\ninterface Node {\n  id: string\n  name: string\n  next?: Array\u003cNode\u003e\n}\n\nconst renderList = (props: Node): Array\u003cJSX.Element\u003e =\u003e {\n  const component = \u003cdiv\u003e{ props.name }\u003c/div\u003e\n  const nodesList = [component]\n\n  if (props?.next \u0026\u0026 props?.next) {\n    props?.next?.map((node) =\u003e nodesList.push(...renderList(node)))\n  }\n  return nodesList\n}\n\nexport default () =\u003e {\n  const tree: Node = {id: \"1\", name: \"demo\"}\n  return (\n    \u003cdiv\u003e\n      \u003cScrollBar width={ 500 } height={ 200 }\u003e\n        { renderList(tree) }\n      \u003c/ScrollBar\u003e\n    \u003c/div\u003e\n  )\n}\n```\n\n## Examples\n\nRun the simple example:\n```bash\n# Make sure that you've installed the dependencies\nnpm install\nnpm run site:dev\n```\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiubiukam%2Fbetter-scrollbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiubiukam%2Fbetter-scrollbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiubiukam%2Fbetter-scrollbar/lists"}