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

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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

Emplacements de contenu exposés par ce composant.

#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

Événements émis par ce composant.

@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.

Interactif

Playground

Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.

Rendu de l’aperçu en cours…

Usage

Exemples

Extraits de code prêts à coller dans vos templates.

Automatic infinite scroll

vue

Manual load mode

vue