{"id":18687986,"url":"https://github.com/dimslaev/scrollnav","last_synced_at":"2025-08-11T07:06:45.246Z","repository":{"id":57317002,"uuid":"314644212","full_name":"dimslaev/scrollnav","owner":"dimslaev","description":"Nicely overflowing navigation for React.","archived":false,"fork":false,"pushed_at":"2023-03-11T19:42:09.000Z","size":318,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-19T00:55:39.830Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://tv0ej6.csb.app/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dimslaev.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-11-20T18:59:07.000Z","updated_at":"2022-11-17T12:51:08.000Z","dependencies_parsed_at":"2025-02-18T20:36:35.161Z","dependency_job_id":"63f7e01b-89ae-415f-bf89-773e9728ea07","html_url":"https://github.com/dimslaev/scrollnav","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dimslaev/scrollnav","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimslaev%2Fscrollnav","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimslaev%2Fscrollnav/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimslaev%2Fscrollnav/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimslaev%2Fscrollnav/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dimslaev","download_url":"https://codeload.github.com/dimslaev/scrollnav/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimslaev%2Fscrollnav/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269844098,"owners_count":24484132,"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","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-07T10:35:08.297Z","updated_at":"2025-08-11T07:06:45.215Z","avatar_url":"https://github.com/dimslaev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Scrollnav v1.2.2\n\nThe `useScrollNav` hook allows you to add a scrollable wrapper around nav items while giving you full control over the UI.\n\n#### NPM Package\n\n```\nnpm i @dims/scrollnav\n```\n\n#### Usage\n\n```javascript\nimport { useScrollNav } from '@dims/scrollnav';\nconst ExampleNavComponent = () =\u003e {\n  const listRef = React.useRef();\n  const { canScrollPrev, canScrollNext, scrollPrev, scrollNext } = useScrollNav(\n    { listRef }\n  );\n  return (\n    \u003cnav\u003e\n      \u003cul ref={listRef}\u003e\n        \u003cli\u003enav item 1\u003c/li\u003e\n        \u003cli\u003enav item 2\u003c/li\u003e\n        \u003cli\u003enav item 3\u003c/li\u003e\n        \u003cli\u003enav item 4\u003c/li\u003e\n      \u003c/ul\u003e\n      {canScrollPrev \u0026\u0026 \u003cbutton onClick={scrollPrev}\u003e\u003c\u003c/button\u003e}\n      {canScrollNext \u0026\u0026 \u003cbutton onClick={scrollNext}\u003e\u003e\u003c/button\u003e}\n    \u003c/nav\u003e\n  );\n};\n```\n\n#### Example\n\nSee `./src/Example.jsx`.\n\nHook params:\n\n```md\n| Prop           | Type   | Required | Description                                       |\n| -------------- | ------ | -------- | ------------------------------------------------- |\n| listRef        | Object | yes      | Ref of the direct parent of your nav items        |\n| scrollStepSize | Number | no       | % of the container width to scroll on arrow click |\n| triggerUpdate  | Bool   | no       | Programatically trigger a re-render               |\n```\n\nHook returns:\n\n```md\n| Prop               | Type         |\n| ------------------ | ------------ |\n| canScrollPrev      | Bool         |\n| canScrollNext      | Bool         |\n| scrollPrev         | Func         |\n| scrollNext         | Func         |\n| scrollToChildIndex | Func(number) |\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimslaev%2Fscrollnav","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimslaev%2Fscrollnav","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimslaev%2Fscrollnav/lists"}