2.0.0 • Published 12 months ago

@adofai-gg/svelte-virtualized-infinite-scroll v2.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

Svelte Virtualized Infinite Scroll

Virtualized infinite scroll component for Svelte.

Features

  • Custom scroll elements
  • Variable heights

Installation

yarn add @adofai-gg/svelte-virtualized-infinite-scroll

Usage

<script lang="ts">
  import VirtualizedScroll from "@adofai-gg/svelte-virtualized-infinite-scroll";

  let totalCount = 100000;

  let data = [
    /*...*/
  ];

  const loadMore = () => {
    // ...
  };

  let scrollContainer: HTMLElement;
</script>
<div bind:this={scrollContainer}>
    <VirtualizedScroll {data} itemHeight={100} let:item on:more={(e) => loadMore(e.detail.offset)} total={totalCount} {scrollContainer}>
        <div>
            {item.something}
        </div>
    </VirtualizedScroll>
</div>

Reference

Props

PropTypeDescription
dataArrayThe array of data for the list
gapnumberThe spacing between the elements
scrollContainerHTMLElementThe element to capture scroll
thresholdnumbermore event is called when the rest rest items are less then this value(default: 10)

Events

EventDetailsDescription
more{ offset: number }Called when scroll reaches the bottom
2.1.0-develop.6

12 months ago

2.1.0-develop.7

12 months ago

2.1.0-develop.5

1 year ago

2.1.0-develop.4

1 year ago

2.1.0-develop.3

1 year ago

2.1.0-develop.2

1 year ago

2.1.0-develop.1

1 year ago

1.0.17

2 years ago

1.0.16

2 years ago

2.0.1-develop.1

2 years ago

2.0.0

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago