{"id":13532182,"url":"https://github.com/dolsem/perfectly-scrollable","last_synced_at":"2025-06-14T05:34:10.660Z","repository":{"id":57701906,"uuid":"495928538","full_name":"dolsem/perfectly-scrollable","owner":"dolsem","description":null,"archived":false,"fork":false,"pushed_at":"2022-06-07T17:52:50.000Z","size":35,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-02T19:33:54.857Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/dolsem.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":"2022-05-24T17:43:05.000Z","updated_at":"2024-08-17T21:24:10.000Z","dependencies_parsed_at":"2022-08-29T04:31:48.531Z","dependency_job_id":null,"html_url":"https://github.com/dolsem/perfectly-scrollable","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolsem%2Fperfectly-scrollable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolsem%2Fperfectly-scrollable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolsem%2Fperfectly-scrollable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolsem%2Fperfectly-scrollable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dolsem","download_url":"https://codeload.github.com/dolsem/perfectly-scrollable/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225535531,"owners_count":17484733,"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":[],"created_at":"2024-08-01T07:01:08.829Z","updated_at":"2024-11-20T11:00:17.921Z","avatar_url":"https://github.com/dolsem.png","language":"TypeScript","funding_links":[],"categories":["📦 Components \u0026 Libraries"],"sub_categories":["UI Components"],"readme":"# Perfectly Scrollable\n\n[![size](https://img.shields.io/bundlephobia/minzip/perfectly-scrollable?style=for-the-badge)](https://bundlephobia.com/package/perfectly-scrollable)\n[![](https://img.shields.io/npm/v/perfectly-scrollable?style=for-the-badge)](https://www.npmjs.com/package/perfectly-scrollable)\n[![](https://img.shields.io/npm/dw/perfectly-scrollable?style=for-the-badge)](https://www.npmjs.com/package/perfectly-scrollable)\n\nSolidJS higher-order component for [Perfect Scrollbar](https://perfectscrollbar.com/).\n\n## Installation\n\n```bash\nnpm install perfectly-scrollable\n```\n\n## Example Usage\n\nDefine a scrollable component like this:\n```tsx\n// MyComponent.tsx\nimport { PerfectlyScrollable } from 'perfectly-scrollable';\nimport { Component } from 'solid-js';\n\nexport interface MyComponentProps {\n  ref?: JSX.IntrinsicAttributes['ref'];\n  title: string;\n} \nconst MyComponent: Component\u003cMyComponentProps\u003e =\u003e (props) =\u003e {\n  return (\n    // Make sure to pass the ref down to the element you want to make scrollable\n    // You should also make sure the CSS position property is set on the element\n    \u003cdiv ref={props.ref} style={{ position: 'relative' }}\u003e\n      \u003ch1\u003e{props.title}\u003c/h1\u003e\n    \u003c/div\u003e\n  );\n};\n\nexport default PerfectlyScrollable(MyComponent);\n```\n\nThe resulting component props will include all `MyComponent` props and [all Perfect Scrollbar props](https://perfectscrollbar.com/#section-options):\n```tsx\n// App.tsx\nimport MyComponent from './MyComponent.tsx';\nimport { Component } from 'solid-js';\n\nexport default () =\u003e {\n  return (\n    \u003cMyComponent title=\"some title\" suppressScrollX /\u003e\n  );\n};\n```\n\nYou can add Perfect Scrollbar to native elements as well:\n```tsx\n// MyComponent.tsx\nimport { PerfectlyScrollable } from 'perfectly-scrollable';\nimport { Component } from 'solid-js';\n\nconst ScrollableDiv = PerfectlyScrollable('div');\n\nexport interface MyComponentProps {\n  ref?: JSX.IntrinsicAttributes['ref'];\n  title: string;\n} \nconst MyComponent: Component\u003cMyComponentProps\u003e =\u003e (props) =\u003e {\n  return (\n    \u003cScrollableDiv\n      ref={props.ref}\n      // Don't forget to set the position property\n      style={{ position: 'relative' }}\n      suppressScrollX\n    \u003e\n      \u003ch1\u003e{props.title}\u003c/h1\u003e\n    \u003c/ScrollableDiv\u003e\n  );\n};\n\nexport default MyComponent;\n```\n\n## Demo\n\nView a functional demo on CodeSandbox: https://codesandbox.io/s/nxso2r.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdolsem%2Fperfectly-scrollable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdolsem%2Fperfectly-scrollable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdolsem%2Fperfectly-scrollable/lists"}