{"id":15024360,"url":"https://github.com/mdbootstrap/react-back-to-top","last_synced_at":"2026-02-08T14:31:49.455Z","repository":{"id":57746619,"uuid":"521237086","full_name":"mdbootstrap/react-back-to-top","owner":"mdbootstrap","description":"Scroll Back To Top link built with Bootstrap 5. Create a button that appears when you start scrolling and on click smooth scrolls you to the top of the page.  https://mdbootstrap.com/docs/react/extended/back-to-top/","archived":false,"fork":false,"pushed_at":"2022-08-04T12:21:39.000Z","size":272,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-06T12:44:19.497Z","etag":null,"topics":["back","bootstrap","bootstrap-template","bootstrap-theme","bootstrap5","css","html","js","react","scroll","top"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdbootstrap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.pdf","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-04T11:21:21.000Z","updated_at":"2022-08-12T06:20:16.000Z","dependencies_parsed_at":"2022-09-01T18:52:04.499Z","dependency_job_id":null,"html_url":"https://github.com/mdbootstrap/react-back-to-top","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mdbootstrap/react-back-to-top","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdbootstrap%2Freact-back-to-top","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdbootstrap%2Freact-back-to-top/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdbootstrap%2Freact-back-to-top/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdbootstrap%2Freact-back-to-top/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdbootstrap","download_url":"https://codeload.github.com/mdbootstrap/react-back-to-top/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdbootstrap%2Freact-back-to-top/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267668558,"owners_count":24124965,"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-07-29T02:00:12.549Z","response_time":2574,"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":["back","bootstrap","bootstrap-template","bootstrap-theme","bootstrap5","css","html","js","react","scroll","top"],"created_at":"2024-09-24T20:00:10.894Z","updated_at":"2026-02-08T14:31:45.582Z","avatar_url":"https://github.com/mdbootstrap.png","language":"JavaScript","readme":"![MDB Logo](https://mdbootstrap.com/img/Marketing/general/logo/medium/mdb-react.png)\n\n# MDB React 5\n\nScroll Back To Top link built with Bootstrap 5. Create a button that appears when you start scrolling and on click smooth scrolls you to the top of the page.\n\nCheck out [React Scroll Back To Top Documentation](https://mdbootstrap.com/docs/b5/react/extended/back-to-top/) for detailed instructions \u0026 even more examples.\n\n## Basic example (Click on the image to see a live demo)\n[![React Scroll Back To Top Basic Example](https://user-images.githubusercontent.com/108793661/182842001-c85489a0-9a23-4462-86be-bb2441011166.png)](https://mdbootstrap.com/docs/react/extended/back-to-top#section-basic-example)\n```js\nimport React from 'react';\nimport { MDBBtn, MDBContainer, MDBIcon } from 'mdb-react-ui-kit';\n\nfunction App() {\n  let mybutton;\n\n  window.onscroll = function () {\n    mybutton = document.getElementById(\"btn-back-to-top\");\n    scrollFunction(mybutton);\n  };\n\n  function scrollFunction(mybutton) {\n    if (\n      document.body.scrollTop \u003e 20 ||\n      document.documentElement.scrollTop \u003e 20\n    ) {\n      mybutton.style.display = \"block\";\n    } else {\n      mybutton.style.display = \"none\";\n    }\n  }\n\n  function backToTop() {\n    document.body.scrollTop = 0;\n    document.documentElement.scrollTop = 0;\n  }\n\n  return (\n    \u003cMDBContainer fluid\u003e\n\n\n      \u003cMDBBtn \n        onClick={backToTop} \n        id='btn-back-to-top' \n        style={{\n          position: \"fixed\",\n          bottom: \"20px\",\n          right: \"20px\",\n          display: \"none\",\n        }} \n        className='btn-floating' \n        color='danger' \n        size='lg'\u003e\n        \u003cMDBIcon fas icon=\"arrow-up\" /\u003e\n      \u003c/MDBBtn\u003e\n\n\n      \u003cdiv className=\"container mt-4 text-center\" style={{height: '2000px'}}\u003e\n        \u003cp\u003e\n          Start scrolling the page and a strong\n          \u003cstrong\u003e \"Back to top\" button \u003c/strong\u003e will appear in the\n          \u003cstrong\u003e bottom right corner\u003c/strong\u003e of the screen.\n        \u003c/p\u003e\n\n        \u003cp\u003e\n          Click this button and you will be taken to the top of the page.\n        \u003c/p\u003e\n      \u003c/div\u003e\n\n      \u003clink\n        href=\"https://fonts.googleapis.com/css?family=Roboto:300,400,500,700\u0026display=swap\"\n        rel=\"stylesheet\"\n        /\u003e\n      \u003clink\n        href=\"https://use.fontawesome.com/releases/v5.15.1/css/all.css\"\n        rel=\"stylesheet\"\n        /\u003e\n\n\n    \u003c/MDBContainer\u003e\n  );\n}\n\nexport default App;\n```\n## How to use?\n\n1. Download MDB 5 - free REACT UI KIT\n\n2. Choose your favourite customized component and click on the image\n\n3. Copy \u0026 paste the code into your MDB project\n\n[▶️ Subscribe to YouTube channel for web development tutorials \u0026 resources](https://www.youtube.com/MDBootstrap?sub_confirmation=1)\n\n## More extended React documentation\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/code/\"\u003eReact Bootstrap Code\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/gallery/\"\u003eReact Bootstrap Gallery\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/hamburger-menu/\"\u003eReact Bootstrap Hamburger Menu\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/jumbotron/\"\u003eReact Bootstrap Jumbotron\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/maps/\"\u003eReact Bootstrap Maps\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/mega-menu//\"\u003eReact Bootstrap Mega Menu\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/media-object/\"\u003eReact Bootstrap Media object\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/multiselect/\"\u003eReact Bootstrap Multiselect\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/masonry/\"\u003eReact Bootstrap Masonry\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/contact/\"\u003eReact Bootstrap Contact form\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/gradients/\"\u003eReact Bootstrap Gradients\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/pagination/\"\u003eReact Bootstrap Pagination\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/panels/\"\u003eReact Bootstrap Panels\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/social-media/\"\u003eReact Bootstrap Social Media icons \u0026 buttons\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/search/\"\u003eReact Bootstrap Search\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/table-sort/\"\u003eReact Bootstrap Table sort\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/table-responsive/\"\u003eReact Bootstrap Table responsive\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/table-scroll/\"\u003eReact Bootstrap Table scroll\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/table-search/\"\u003eReact Bootstrap Table search\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/textarea/\"\u003eReact Bootstrap Textarea\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/sidebar/\"\u003eReact Bootstrap Sidebar\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/profiles/\"\u003eReact Bootstrap Profiles\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/dropdown-multilevel/\"\u003eReact Bootstrap Nested Dropdown\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/bootstrap-address-form/\"\u003eReact Bootstrap Address Form\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://mdbootstrap.com/docs/react/extended/registration-form/\"\u003eReact Bootstrap Address Form\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdbootstrap%2Freact-back-to-top","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdbootstrap%2Freact-back-to-top","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdbootstrap%2Freact-back-to-top/lists"}