{"id":21524045,"url":"https://github.com/iamriajul/qwik-scroll-to-top","last_synced_at":"2025-03-17T17:45:56.084Z","repository":{"id":198886843,"uuid":"701769733","full_name":"iamriajul/qwik-scroll-to-top","owner":"iamriajul","description":"Lightweight button component for scrolling to the top of a page.","archived":false,"fork":false,"pushed_at":"2023-11-29T12:04:54.000Z","size":72,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-24T12:07:08.033Z","etag":null,"topics":["qwik","scroll","scroll-to-top","scroll-up"],"latest_commit_sha":null,"homepage":"","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/iamriajul.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":"2023-10-07T14:00:34.000Z","updated_at":"2023-12-28T17:57:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"6f35d272-e871-42bc-8f27-e039389a2116","html_url":"https://github.com/iamriajul/qwik-scroll-to-top","commit_stats":null,"previous_names":["iamriajul/qwik-scroll-to-top"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamriajul%2Fqwik-scroll-to-top","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamriajul%2Fqwik-scroll-to-top/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamriajul%2Fqwik-scroll-to-top/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamriajul%2Fqwik-scroll-to-top/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamriajul","download_url":"https://codeload.github.com/iamriajul/qwik-scroll-to-top/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244082449,"owners_count":20395273,"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":["qwik","scroll","scroll-to-top","scroll-up"],"created_at":"2024-11-24T01:20:27.042Z","updated_at":"2025-03-17T17:45:56.059Z","avatar_url":"https://github.com/iamriajul.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# qwik-scroll-to-top\n\nA lightweight and customizable button component that scrolls to the top of a page when pressed  \nThe button is only visible once a certain height has been reached on the page\n\n[![NPM](https://nodei.co/npm/react-scroll-to-top.png)](https://nodei.co/npm/react-scroll-to-top/)\n\n## Live demo\n\n[A live demo can be found here](https://codesandbox.io/s/react-scroll-to-top-demo-rmuvx?file=/src/App.js)\n\n## Installation\n\nWith pnpm:\n\n```sh\npnpm i qwik-scroll-to-top\n```\n\nWith npm:\n\n```sh\nnpm i qwik-scroll-to-top\n```\n\nor with Yarn:\n\n```sh\n yarn add qwik-scroll-to-top\n ```\n\n## Usage\n\nImport and then add `\u003cScrollToTop /\u003e` at the bottom of your return function (for a11y reasons):\n\n```js\nimport { ScrollToTop } from \"qwik-scroll-to-top\";\n\nfunction CoolPage() {\n  return (\n    \u003cdiv\u003e\n      \u003ch1\u003eHello, world!\u003c/h1\u003e\n      \u003cdiv style={{ marginTop: \"150vh\" }} /\u003e\n      \u003cScrollToTop smooth /\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n## Props\n\n| Prop      | Type    | Description                                                                      | Default       |\n|-----------| ------- |----------------------------------------------------------------------------------| ------------- |\n| useSlot   | boolean | Whether you want use your passed Slot(children) as Icon of the button            | false         |\n| smooth    | boolean | Whether to use smooth scrolling\\*                                                | false         |\n| top       | number  | Height after page scroll to be visible                                           | 20            |\n| color     | string  | The SVG icon fill color                                                          | \"black\"       |\n| svgPath   | string  | The SVG icon path d attribute                                                    | An arrow path |\n| width     | string  | The SVG icon width                                                               | \"28\"          |\n| height    | string  | The SVG icon height                                                              | \"28\"          |\n| viewBox   | string  | The SVG icon viewBox attribute                                                   | \"0 0 256 256\" |\n| component | any     | Component to override SVG icon. See examples                                     |               |\n| style     | Object  | Object to add/override styling                                                   |               |\n| class     | string  | Class to add/override styling (note, `!important` for overrides might be needed) |               |\n\nSmooth scrolling uses a newer `window.scrollTo` implementation.\\\n[Check out its support in browsers at MDN web docs](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo).\n\n## Examples\n\n[With custom SVG path](https://codesandbox.io/s/react-scroll-to-top-svg-path-y2ztc?file=/src/App.js)  \n[With custom SVG component](https://codesandbox.io/s/react-scroll-to-top-custom-svg-or74g?file=/src/App.js)  \n[With custom DOM element](https://codesandbox.io/s/react-scroll-to-top-custom-dom-element-y7j0f?file=/src/App.js)\n\n## Types\n\nWritten in TypeScript, no need for @types installation\n\nPorted from: [react-scroll-to-top](https://github.com/HermanNygaard/react-scroll-to-top)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamriajul%2Fqwik-scroll-to-top","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamriajul%2Fqwik-scroll-to-top","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamriajul%2Fqwik-scroll-to-top/lists"}