{"id":13604266,"url":"https://github.com/andrelmlins/svelte-infinite-scroll","last_synced_at":"2025-04-04T15:11:37.628Z","repository":{"id":36195343,"uuid":"222257914","full_name":"andrelmlins/svelte-infinite-scroll","owner":"andrelmlins","description":"Infinite Scroll Component to Svelte","archived":false,"fork":false,"pushed_at":"2023-07-18T20:58:24.000Z","size":1141,"stargazers_count":267,"open_issues_count":8,"forks_count":13,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-28T14:11:27.724Z","etag":null,"topics":["infinite","infinite-scroll","scroll","svelte"],"latest_commit_sha":null,"homepage":"https://svelte-infinite-scroll.netlify.com/","language":"Svelte","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/andrelmlins.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-11-17T14:09:05.000Z","updated_at":"2025-01-10T05:17:19.000Z","dependencies_parsed_at":"2024-01-15T13:33:17.062Z","dependency_job_id":null,"html_url":"https://github.com/andrelmlins/svelte-infinite-scroll","commit_stats":{"total_commits":93,"total_committers":8,"mean_commits":11.625,"dds":"0.29032258064516125","last_synced_commit":"a2ccf854215f21816fd6551ffebbd36259a03bbf"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrelmlins%2Fsvelte-infinite-scroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrelmlins%2Fsvelte-infinite-scroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrelmlins%2Fsvelte-infinite-scroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrelmlins%2Fsvelte-infinite-scroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrelmlins","download_url":"https://codeload.github.com/andrelmlins/svelte-infinite-scroll/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198469,"owners_count":20900081,"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":["infinite","infinite-scroll","scroll","svelte"],"created_at":"2024-08-01T19:00:42.558Z","updated_at":"2025-04-04T15:11:37.604Z","avatar_url":"https://github.com/andrelmlins.png","language":"Svelte","funding_links":[],"categories":["UI Componentes","Svelte"],"sub_categories":["Comunidade Global"],"readme":"# Svelte Infinite Scroll\n\n[![npm version](https://badge.fury.io/js/svelte-infinite-scroll.svg)](https://www.npmjs.com/package/svelte-infinite-scroll) \u0026bull; [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/andrelmlins/svelte-infinite-scroll/blob/master/LICENSE) \u0026bull; [![Build Status](https://travis-ci.com/andrelmlins/svelte-infinite-scroll.svg?branch=master)](https://travis-ci.com/andrelmlins/svelte-infinite-scroll) \u0026bull; [![Netlify Status](https://api.netlify.com/api/v1/badges/a16b6807-8f05-4e03-8ed4-33e5162155bb/deploy-status)](https://app.netlify.com/sites/svelte-infinite-scroll/deploys) \u0026bull; [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/andrelmlins/svelte-infinite-scroll.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/andrelmlins/svelte-infinite-scroll/context:javascript) \u0026bull; [![Gitter](https://badges.gitter.im/svelte-infinite-scroll/community.svg)](https://gitter.im/svelte-infinite-scroll/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n\nInfinite Scroll Component to Svelte.\n\n## Installation\n\n```bash\nnpm i svelte-infinite-scroll\n\n// or\n\nyarn add svelte-infinite-scroll\n```\n\n_Note: to use this library in Sapper applications, install as devDependency. Take a look at [this link](https://github.com/sveltejs/sapper-template#using-external-components)._\n\n## Demo [link](https://svelte-infinite-scroll.netlify.com/)\n\nLocal demo:\n\n```bash\ngit clone https://github.com/andrelmlins/svelte-infinite-scroll.git\ncd svelte-infinite-scroll\nnpm install \u0026\u0026 npm run dev\n```\n\n## Examples\n\nAn example of how to use the library:\n\n```svelte\n\u003cscript\u003e\n  import InfiniteScroll from \"svelte-infinite-scroll\";\n  import allCountries from \"./countries.js\";\n\n  let page = 0;\n  let size = 20;\n  let countries = [];\n\n  $: countries = [\n    ...countries,\n    ...allCountries.splice(size * page, size * (page + 1) - 1)\n  ];\n\u003c/script\u003e\n\n\u003cstyle\u003e\n  ul {\n    width: 400px;\n    max-height: 400px;\n    overflow-x: scroll;\n  }\n\u003c/style\u003e\n\n\u003cul\u003e\n  {#each countries as country}\n    \u003cli\u003e{country.name}\u003c/li\u003e\n  {/each}\n  \u003cInfiniteScroll threshold={100} on:loadMore={() =\u003e page++} /\u003e\n\u003c/ul\u003e\n```\n\n### Another examples\n\n- Infinite scroll with requests | [Link](https://svelte.dev/repl/4863a658f3584b81bbe3d9f54eb67899) | [Author](https://github.com/kilianso)\n- Infinite scroll reverse | [Link](https://svelte.dev/repl/36d00aa55c7c4ff68914ce314f4e1ca4) | [Author](https://github.com/andrelmlins)\n\n## Properties\n\nComponent props:\n\n| Prop            | Type   | Default | Description                               |\n| --------------- | ------ | ------- | ----------------------------------------- |\n| `threshold`     | number | 0       | Threshold to call loadMore                |\n| `elementScroll` | node   | -       | Element to bind scroll                    |\n| `window`        | bool   | false   | Bind scroll in window                     |\n| `hasMore`       | bool   | true    | Tells you if there are more items to load |\n| `horizontal`    | bool   | false   | Changing orientation                      |\n| `reverse`       | bool   | false   | Revese scroll direction                   |\n\n## Events\n\n| Event      | Description                               |\n| ---------- | ----------------------------------------- |\n| `loadMore` | Tells you if there are more items to load |\n\n## NPM statistics\n\nDownload stats for this NPM package.\n\n[![NPM](https://nodei.co/npm/svelte-infinite-scroll.png)](https://nodei.co/npm/svelte-infinite-scroll/)\n\n## License\n\nSvelte Infinite Scroll is open source software [licensed as MIT](https://github.com/andrelmlins/svelte-infinite-scroll/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrelmlins%2Fsvelte-infinite-scroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrelmlins%2Fsvelte-infinite-scroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrelmlins%2Fsvelte-infinite-scroll/lists"}