{"id":20903863,"url":"https://github.com/minjieliu/mac-scrollbar","last_synced_at":"2025-05-15T22:02:46.045Z","repository":{"id":44511680,"uuid":"398583109","full_name":"MinJieLiu/mac-scrollbar","owner":"MinJieLiu","description":"Scrollbar React component with macOS style.","archived":false,"fork":false,"pushed_at":"2025-01-05T08:53:34.000Z","size":1449,"stargazers_count":203,"open_issues_count":3,"forks_count":12,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-01T05:38:03.096Z","etag":null,"topics":["macos","react-component","scrollbar"],"latest_commit_sha":null,"homepage":"https://MinJieLiu.github.io/mac-scrollbar","language":"TypeScript","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/MinJieLiu.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,"publiccode":null,"codemeta":null}},"created_at":"2021-08-21T14:48:09.000Z","updated_at":"2025-03-25T09:38:26.000Z","dependencies_parsed_at":"2022-08-12T11:20:20.289Z","dependency_job_id":"d1116f53-637a-41d4-bb4f-3379f30c2fbd","html_url":"https://github.com/MinJieLiu/mac-scrollbar","commit_stats":{"total_commits":101,"total_committers":5,"mean_commits":20.2,"dds":0.03960396039603964,"last_synced_commit":"9ff279d5d732b49486d79ed486f64babf437bde1"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinJieLiu%2Fmac-scrollbar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinJieLiu%2Fmac-scrollbar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinJieLiu%2Fmac-scrollbar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinJieLiu%2Fmac-scrollbar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MinJieLiu","download_url":"https://codeload.github.com/MinJieLiu/mac-scrollbar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247801175,"owners_count":20998339,"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":["macos","react-component","scrollbar"],"created_at":"2024-11-18T13:15:14.359Z","updated_at":"2025-04-08T08:16:25.984Z","avatar_url":"https://github.com/MinJieLiu.png","language":"TypeScript","readme":"# mac-scrollbar\n\n**English** | [中文](./packages/mac-scrollbar/README.zh-CN.md)\n\n[![npm](https://img.shields.io/npm/v/mac-scrollbar.svg?style=flat-square)](https://www.npmjs.com/package/mac-scrollbar) [![mac-scrollbar](https://badgen.net/bundlephobia/minzip/mac-scrollbar)](https://github.com/MinJieLiu/mac-scrollbar) [![mac-scrollbar](https://badgen.net/npm/dt/mac-scrollbar)](https://github.com/MinJieLiu/mac-scrollbar)\n\n\u003e Scrollbar React component with macOS style.\n\n## Why `mac-scrollbar`\n\nThe scroll bar of each browser has a unique style and the width is also inconsistent, thus compressing the display of the content area. Now, we need a beautiful and simple scroll bar from macOS style.\n\n- Use native browser to scroll\n- Does not affect the design layout\n- No additional DOM hierarchy\n- Automatically adapt to change in width and height\n- 2KB compressed size\n- Support Chrome, Firefox \u003e= 64, Microsoft Edge \u003e= 79\n\n**Note** This component is not compatible with IE11, it needs to be compatible with lower version browsers.\n\n![demo](./demo.gif)\n\n## Usage\n\n```shell\nyarn add mac-scrollbar\n```\n\nImport style\n\n```jsx\nimport 'mac-scrollbar/dist/mac-scrollbar.css';\n```\n\nBasic\n\n```tsx\nimport { MacScrollbar } from 'mac-scrollbar';\n\nfunction Foo() {\n  return (\n    \u003cMacScrollbar\u003e\n      \u003cdiv\u003eContent\u003c/div\u003e\n    \u003c/MacScrollbar\u003e\n  );\n}\n```\n\nGlobal window scrollbar\n\n```tsx\nimport { GlobalScrollbar } from 'mac-scrollbar';\n\nfunction App() {\n  return \u003cGlobalScrollbar /\u003e;\n}\n```\n\n### API\n\n#### Common\n\n| Name             | Type                                                                       | Description                                                       |\n| :--------------- | :------------------------------------------------------------------------- | :---------------------------------------------------------------- |\n| skin             | 'light' \\| 'dark'                                                          | Adapt to the background color of the container. Default 'light'   |\n| trackGap         | number \\| TrackGap \\| ((showBarX: boolean, showBarY: boolean) =\u003e TrackGap) | Gap at the cross end of the scroll bar. Default 16                |\n| trackStyle       | (horizontal?: boolean) =\u003e CSSProperties                                    |                                                                   |\n| thumbStyle       | (horizontal?: boolean) =\u003e CSSProperties                                    |                                                                   |\n| minThumbSize     | number                                                                     | Minimum thumb bar size. Default 20                                |\n| suppressAutoHide | boolean                                                                    | When set to true, the scrollbar will not be automatically hidden. |\n\n#### MacScrollbar\n\n| Name            | Type   | Description                                                                                         |\n| :-------------- | :----- | :-------------------------------------------------------------------------------------------------- |\n| suppressScrollX | number | When set to true, the scrollbar in X-axis will not be available, regardless of the content width.   |\n| suppressScrollY | number | When set to true, the scroll bar in Y-axis will not be available, regardless of the content height. |\n| as              | string | Custom element type. Default 'div'                                                                  |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminjieliu%2Fmac-scrollbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminjieliu%2Fmac-scrollbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminjieliu%2Fmac-scrollbar/lists"}