• Stars
    star
    267
  • Rank 153,621 (Top 4 %)
  • Language Svelte
  • License
    MIT License
  • Created about 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Infinite Scroll Component to Svelte

Svelte Infinite Scroll

npm versionLicense: MITBuild StatusNetlify StatusLanguage grade: JavaScriptGitter

Infinite Scroll Component to Svelte.

Installation

npm i svelte-infinite-scroll

// or

yarn add svelte-infinite-scroll

Note: to use this library in Sapper applications, install as devDependency. Take a look at this link.

Demo link

Local demo:

git clone https://github.com/andrelmlins/svelte-infinite-scroll.git
cd svelte-infinite-scroll
npm install && npm run dev

Examples

An example of how to use the library:

<script>
  import InfiniteScroll from "svelte-infinite-scroll";
  import allCountries from "./countries.js";

  let page = 0;
  let size = 20;
  let countries = [];

  $: countries = [
    ...countries,
    ...allCountries.splice(size * page, size * (page + 1) - 1)
  ];
</script>

<style>
  ul {
    width: 400px;
    max-height: 400px;
    overflow-x: scroll;
  }
</style>

<ul>
  {#each countries as country}
    <li>{country.name}</li>
  {/each}
  <InfiniteScroll threshold={100} on:loadMore={() => page++} />
</ul>

Another examples

Properties

Component props:

Prop Type Default Description
threshold number 0 Threshold to call loadMore
elementScroll node - Element to bind scroll
window bool false Bind scroll in window
hasMore bool true Tells you if there are more items to load
horizontal bool false Changing orientation
reverse bool false Revese scroll direction

Events

Event Description
loadMore Tells you if there are more items to load

NPM statistics

Download stats for this NPM package.

NPM

License

Svelte Infinite Scroll is open source software licensed as MIT.

More Repositories

1

svelte-fullscreen

Component that performs fullscreen in DOM Elements
Svelte
65
star
2

svelte-grid-responsive

Responsive grid system based on Bootstrap for Svelte
Svelte
54
star
3

freesoccer

⚽ Free API with results from national soccer competitions
TypeScript
35
star
4

react-shadow-scroll

Component that customizes the list and inserts shadow when scrolling exists
JavaScript
29
star
5

vue-grid-responsive

Responsive grid system based on Bootstrap for Vue
Vue
29
star
6

svelte-dts

Typescript declaration generator for svelte with typescript
TypeScript
28
star
7

react-fullscreen

Component that performs fullscreen in DOM Elements
JavaScript
27
star
8

create-react-dependency

Project similar to the Create React App for libraries and dependencies
JavaScript
25
star
9

react-whatsapp

React component for whatsapp click to chat
JavaScript
22
star
10

revelt

Analysis of a project using React and Svelte technologies
JavaScript
21
star
11

svelte-device-detector

Render views on different device types
JavaScript
19
star
12

frontend-chronology

FrontEnd chronology of javascript frameworks and libraries
CSS
14
star
13

svelte-resize-observer

Element resize observer to Svelte
Svelte
13
star
14

svelte-github-login

Github Login Component to Svelte
Svelte
12
star
15

cpf_cnpj

Validador de CPF e CNPJ para Rust.
Rust
10
star
16

previsao-ondas

🌊 Scraping de previsão de ondas no Brasil
TypeScript
10
star
17

svelte-facebook-login

Facebook Login Component to Svelte
Svelte
8
star
18

variables-loader

Webpack loader to parse variables
JavaScript
8
star
19

spotify-login

WebComponent for Spotify Login
TypeScript
7
star
20

react-string-checker

String Literal Searcher
JavaScript
6
star
21

svelte-internet-connection

Internet connection detector to Svelte
Svelte
6
star
22

ci-npm-publish

Examples of continuous integration for publishing npm packages.
5
star
23

puppeteer-extra-plugin-auto-scroll

A auto scroll plugin for puppeteer-extra
JavaScript
5
star
24

rbf-dda

Radial Basis Function (RBF) with Dynamic Decay Adjustment (DDA) algorithm
TypeScript
3
star
25

numero-por-extenso

Biblioteca Rust para conversão por extenso de valores numéricos.
Rust
3
star
26

vue-scroll-shadow

Component that customizes the scroll and inserts shadow when scrolling exists
JavaScript
3
star
27

flashlink

Save links in storage
Reason
3
star
28

svelte-scripts

Configurations and scripts for svelte applications and svelte libraries
JavaScript
3
star
29

coloring

🌈 Convert values to color simply and securely.
Rust
3
star
30

react-webcomponent-example

WebComponent example
JavaScript
3
star
31

react-input-por-extenso

Componente React que retorna número por extenso
JavaScript
3
star
32

gerenciamento_processos

Java
2
star
33

choose-port

Choose an available port
JavaScript
2
star
34

whatsup-with-rollup

Whatsup project with rollup
TypeScript
2
star
35

svelte-document-title

A document.title manager for Svelte
JavaScript
2
star
36

see-dependency

See all the details of an npm dependency
JavaScript
2
star
37

svelte-scroll-shadow

Component that customizes the scroll and inserts shadow when scrolling exists
Svelte
2
star
38

parser-docker-variables

Parser docker variables for javascript
Shell
1
star
39

preact-fullscreen

Component that performs fullscreen in DOM Elements
JavaScript
1
star
40

bs-react-whatsapp

ReasonML bindings for the react-whatsapp
Reason
1
star
41

whatsup-document-title

Page title manager for whatsup
JavaScript
1
star
42

react-native-tracing

Example of React Native tracing
Java
1
star
43

svelte-transpile-typescript

Transpile typescript in the svelte files
TypeScript
1
star
44

marvel-heroes

JavaScript
1
star
45

bs-react-shadow-scroll

ReasonML bindings for the react-shadow-scroll
Reason
1
star
46

react-pixi-example

React pixi example
JavaScript
1
star
47

encheotanque

Aplicativo Enche o Tanque
Java
1
star