{"id":29161343,"url":"https://github.com/trembacz/react-scroll-to-element","last_synced_at":"2025-07-01T03:40:01.272Z","repository":{"id":57344261,"uuid":"112038498","full_name":"trembacz/react-scroll-to-element","owner":"trembacz","description":"Scroll to any element of your React application","archived":false,"fork":false,"pushed_at":"2020-01-17T21:10:24.000Z","size":19,"stargazers_count":11,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-16T21:14:50.702Z","etag":null,"topics":["class","element","id","offset","pixels","react","scroll"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/trembacz.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":"2017-11-25T22:23:49.000Z","updated_at":"2021-05-16T18:08:37.000Z","dependencies_parsed_at":"2022-09-11T08:41:58.535Z","dependency_job_id":null,"html_url":"https://github.com/trembacz/react-scroll-to-element","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/trembacz/react-scroll-to-element","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trembacz%2Freact-scroll-to-element","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trembacz%2Freact-scroll-to-element/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trembacz%2Freact-scroll-to-element/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trembacz%2Freact-scroll-to-element/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trembacz","download_url":"https://codeload.github.com/trembacz/react-scroll-to-element/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trembacz%2Freact-scroll-to-element/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260310126,"owners_count":22989819,"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":["class","element","id","offset","pixels","react","scroll"],"created_at":"2025-07-01T03:40:00.722Z","updated_at":"2025-07-01T03:40:01.246Z","avatar_url":"https://github.com/trembacz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-scroll-to-element\nScroll to any element of your React application\n\n[![Build Status](https://travis-ci.org/trembacz/react-scroll-to-element.svg?branch=master)](https://travis-ci.org/trembacz/react-scroll-to-element)\n[![Dependencies](https://david-dm.org/trembacz/react-scroll-to-element/status.svg)](https://david-dm.org/trembacz/react-scroll-to-element?view=list)\n[![devDependencies](https://david-dm.org/trembacz/react-scroll-to-element/dev-status.svg)](https://david-dm.org/trembacz/react-scroll-to-element?type=dev\u0026view=list)\n\n## Getting Started\n\n**1. Install**\n\n```npm install react-scroll-to-element```\nor\n```yarn add react-scroll-to-element```\n\n**2. Options**\n\n| Option              | Value         | Description                                                          |\n| ------------------- |:-------------:| -------------------------------------------------------------------- |\n| ```type```          | ```string```  | ```id``` or ```class``` - Not required if you want to set offset only|\n| ```element```       | ```string```  | Scroll to this element (use with ```type```)                         |\n| ```offset```        | ```number```  | Scroll ```x``` pixels down                                           |\n| ```timeout```       | ```number```  | Start scrolling after ```x``` ms                                     |\n| ```children```      | ```string```  | Text or html tags                                                    |\n\n**3. Usage**\n\n```js\n\nimport Scroll from 'react-scroll-to-element';\n\n\u003cScroll type=\"id\" element=\"title\"\u003e\n  Scroll to element with id 'title'\n\u003c/Scroll\u003e\n\n\u003cScroll type=\"class\" element=\"contact\"\u003e\n  Scroll to element with class 'contact'\n\u003c/Scroll\u003e\n\n\u003cScroll\u003e\n  Scroll to top\n\u003c/Scroll\u003e\n\n\u003cScroll offset={200}\u003e\n  Scroll 200 px down (from top)\n\u003c/Scroll\u003e\n\n\u003cScroll offset={200} timeout={3000}\u003e\n  Scroll 200 px down (from top) after 3 seconds\n\u003c/Scroll\u003e\n\n\u003cScroll type=\"class\" element=\"contact\" offset={200} timeout={3000}\u003e\n  Scroll to element with class 'contact' + 200 px down after 3 seconds\n\u003c/Scroll\u003e\n\n\u003cScroll type=\"class\" element=\"contact\" offset={-100}\u003e\n  Scroll to element with class 'contact' - 100 px\n\u003c/Scroll\u003e\n```\n\n***You can also use html tags inside the component***\n\n```js\n\u003cScroll type=\"class\" element=\"contact\" offset={-100} timeout={3000}\u003e\n  \u003cbutton\u003eClick me\u003c/button\u003e\n\u003c/Scroll\u003e\n```\n\n[smoothscroll-polyfill](https://github.com/iamdustan/smoothscroll) used for older browsers\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrembacz%2Freact-scroll-to-element","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrembacz%2Freact-scroll-to-element","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrembacz%2Freact-scroll-to-element/lists"}