{"id":25938612,"url":"https://github.com/michaeljscript/next-restore-scroll-position","last_synced_at":"2025-08-16T18:10:24.001Z","repository":{"id":157080292,"uuid":"633293169","full_name":"michaeljscript/next-restore-scroll-position","owner":"michaeljscript","description":"Restore scroll position using NextJS","archived":false,"fork":false,"pushed_at":"2023-07-02T18:31:35.000Z","size":40,"stargazers_count":12,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-29T07:42:17.269Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaeljscript.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}},"created_at":"2023-04-27T07:32:59.000Z","updated_at":"2024-04-27T19:38:55.000Z","dependencies_parsed_at":"2024-01-28T18:20:58.816Z","dependency_job_id":"16054f99-ac74-43c3-ae4b-14bea3184740","html_url":"https://github.com/michaeljscript/next-restore-scroll-position","commit_stats":null,"previous_names":["michaeljscript/next-restore-scroll-position","michalszorad/next-restore-scroll-position"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/michaeljscript/next-restore-scroll-position","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeljscript%2Fnext-restore-scroll-position","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeljscript%2Fnext-restore-scroll-position/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeljscript%2Fnext-restore-scroll-position/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeljscript%2Fnext-restore-scroll-position/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaeljscript","download_url":"https://codeload.github.com/michaeljscript/next-restore-scroll-position/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeljscript%2Fnext-restore-scroll-position/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270749561,"owners_count":24638761,"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-16T02:00:11.002Z","response_time":91,"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":"2025-03-04T03:37:40.254Z","updated_at":"2025-08-16T18:10:23.977Z","avatar_url":"https://github.com/michaeljscript.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Restore scroll position in NextJS\n\nRestores scroll position when navigating back and forth in NextJS.\n\n## Installation\n\n```\nyarn add next-restore-scroll-position\n```\n\n```\nnpm i next-restore-scroll-position\n```\n\n\n## Usage\n```js\nimport { useScrollRestoration } from 'next-restore-scroll-position';\n\nfunction App() { // This needs to be NextJS App Component\n    const router = useRouter();\n    useScrollRestoration(router);\n}\n```\n\n**You can also disable the scroll restoration by passing `enabled` property**\n\n```js\nimport { useScrollRestoration } from 'next-restore-scroll-position';\n\nfunction App() { // This needs to be NextJS App Component\n    const router = useRouter();\n    useScrollRestoration(router, {enabled: false});\n}\n```\n\n## Peer dependencies\n\n- React 16 or up\n- Next 13\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaeljscript%2Fnext-restore-scroll-position","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaeljscript%2Fnext-restore-scroll-position","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaeljscript%2Fnext-restore-scroll-position/lists"}