InfiniteScroll

Data Display
stable

Sentinel-based infinite scroll that fires a load event when the user reaches the start or end of a scrollable area.

API

Props

All props accepted by this component, with their type, default value and description.

side
TInfiniteScrollSide
'end'
Which edge(s) of the scroll area to observe. "both" watches top and bottom simultaneously.
mode
TInfiniteScrollMode
'intersect'
How the next page is triggered. "intersect" fires automatically when the sentinel enters the viewport; "manual" shows a Load More button.
loadMoreText
string
'Load more'
Label for the Load More button shown in manual mode.
emptyText
string
'No more items'
Message displayed when the done callback is called with "empty".
margin
string
Root margin passed to the IntersectionObserver. Expands the detection zone, e.g. "0px 0px 200px 0px" to load ahead.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
color
TColor
Color applied to the progress spinner and the Load More button.
bgColor
TColor
height
number | string
Explicit height. Set this to make the component itself the scroll container.
maxHeight
number | string
Maximum height before the scroll container clips and scrolls.
maxWidth
number | string
minHeight
number | string
minWidth
number | string
width
number | string
tag
string
'div'
HTML element rendered at the root of the scroll container.
direction
TDirection
'vertical'
Scroll axis to observe.
fontSize
TFontSize

API

Slots

Content slots exposed by this component.

#error
Content shown after done("error") is called. Use props.onClick to retry.
#empty
Content shown after done("empty") is called. The default renders the emptyText string.
#loading
Custom loading indicator shown while a page fetch is in flight. The default renders an OrigamProgress spinner.
#loadMore
Custom Load More trigger shown in manual mode. The default renders an OrigamBtn.
#default
The scrollable list content. Items are appended here as new pages load.

API

Emits

Events emitted by this component.

@load
{ side: TInfiniteScrollSide, done: (status: 'ok' | 'empty' | 'error') => void }
Fired when the sentinel enters the viewport (or the user clicks Load More in manual mode). Call done("ok") after appending data, done("empty") when there are no more pages, or done("error") on failure.

Interactive

Playground

Edit props live and see the component update in real time. The generated code snippet updates as you change values.

Rendering the live preview…

Usage

Examples

Ready-to-paste code snippets for your templates.

Automatic infinite scroll

vue

Manual load mode

vue