uipack

Infinite scroll

Infinite scroll offers a frictionless pagination i.e an ability to scroll endlessly through multiple pages where succeeding pages get loaded into view as you scroll towards them. We might add the the necessary accessibility attributes into the component in the future but right now we can only recommend you use role="feed" and the links in the notes below especially when you use infinite scroll for a list of articles.

Usage

import InfiniteScroll from '@ui-pack/react/infinite-scroll'

Notes

Props

as

oneOfType: string, function

Default: div

loadingMessage

node

Default:

Loading...

completionMessage

node

emptyMessage

node

errorMessage

node

initialPage

number

Default: 1

loadFunction

functionrequired

children

functionrequired

onError

function

threshold

number

Default: 500

innerProps

object

pageLimit

number

Default: 1000

scrollParentSelector

string

scrollContentSelector

string