Skip to content

OrigamInfiniteScroll ​

<OrigamInfiniteScroll> fires a load event when the user scrolls near the start or end of the container. It supports both automatic (intersection-observer) and manual (button) modes.

Basic usage ​

vue
<template>
    <OrigamInfiniteScroll @load="loadMore" style="max-height: 400px; overflow-y: auto;">
        <div v-for="item in items" :key="item.id">{{ item.name }}</div>
    </OrigamInfiniteScroll>
</template>

<script setup>
const items = ref([...])
const loadMore = ({ side, done }) => {
    // fetch more items, then call done('ok' | 'empty' | 'error')
    done('ok')
}
</script>

Modes ​

PropTypeDefaultDescription
modeTInfiniteScrollMode'intersect''intersect' uses IntersectionObserver; 'manual' shows a button
sideTInfiniteScrollSide'end'Which side triggers: 'start', 'end', or 'both'

Dimension and margin ​

PropTypeDescription
heightstring | numberHeight of the scroll container
widthstring | numberWidth of the scroll container
marginstringrootMargin for the IntersectionObserver

Slots ​

SlotBindingsDescription
default—Scrollable content
loading{ side, props }Custom loading indicator
empty{ side, props }Shown when no more items (status='empty')
error{ side, props }Shown on load error (status='error')
loadMore{ side, props }Custom "load more" button (manual mode)

Emits ​

EventPayloadDescription
load{ side: TInfiniteScrollSide, done: (status: TInfiniteScrollStatus) => void }Fires when more data should be loaded

Typography ​

Controls the font size of the loading / empty / error text inside the side panels. Only fontSize has a real visual effect; the SCSS reads --origam-infinite-scroll__loader---font-size on .origam-infinite-scroll__side.

PropTypeDefaultDescription
fontSizeTFontSize—Font-size token (xs · sm · md · lg · xl · 2xl · 3xl · 4xl · 5xl). Overrides the loader text size without touching other text in the scroll area.

Design tokens ​

TokenDescription
--origam-infinite-scroll---*Component-level token namespace
--origam-infinite-scroll__loader---font-sizeFont size of the side-panel loader text (default 0.875rem)