Quick Example
useInfiniteScroll Usage
ตัวอย่าง import และการใช้งานแบบสั้นสำหรับหน้า `use-infinite-scroll`
Code
<script lang="ts">
import { useInfiniteScroll } from 'svelora';
const loadMore = () => {
console.log('load more');
};
</script>
<div use:useInfiniteScroll={{ onLoadMore: loadMore }}>
Scroll to load more
</div>
useInfiniteScroll
Reactive infinite scroll hook with Svelte action. Triggers a callback when the user scrolls near the bottom of a container.
Basic
Scroll down inside the container to load more items. Stops at 100 items.
Items: 20 Loads: 0 Has more
Item 1 #1
Item 2 #2
Item 3 #3
Item 4 #4
Item 5 #5
Item 6 #6
Item 7 #7
Item 8 #8
Item 9 #9
Item 10 #10
Item 11 #11
Item 12 #12
Item 13 #13
Item 14 #14
Item 15 #15
Item 16 #16
Item 17 #17
Item 18 #18
Item 19 #19
Item 20 #20
Table + Infinite Scroll
Combine with the Table component for paginated data loading. Scroll the table to automatically load more rows. Stops at 150 users.
Users: 30 Loads: 0 Has more