2.0.0 • Published 12 months ago
@adofai-gg/svelte-virtualized-infinite-scroll v2.0.0
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
Prop | Type | Description |
---|---|---|
data | Array | The array of data for the list |
gap | number | The spacing between the elements |
scrollContainer | HTMLElement | The element to capture scroll |
threshold | number | more event is called when the rest rest items are less then this value(default: 10) |
Events
Event | Details | Description |
---|---|---|
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