DataList
A infinite-scrollable list that supports paging in of items
Installation
Examples
Properties
data
Array | IDataFunction
List of items to render. This can either be an array of objects or a function that will generate the array of objects. If you supply a function then pagination will be supported. The function expects 2 parameters - max
and last
and returns a promise that will resolve to the list of objects. max
specifies the maximum number of items to be returned.
renderItem
(item: any, key: number) => JSX.Element
A function that will be responsible for rendering each individual element of the list. It is common to return ItemCard
component from here.
pageSize
number
The number of items to fetch in each page. This gets passed to the data function as the max
parameter
args
any
renderLoading
() => JSX.Element
This function renders a loading animation. If not specified, the default loading animation will be used.
className
string
Any extra class names to be added to the component
showFooter
boolean
show/hide footer (scroll buttons)
scrollStep
number
mun of rows to scroll
showEndOfContent
boolean
show/hide end of content message
onItemsLoad
(total: number, loaded: number, items?: any[]) => void
this function will be called every time list get updated this will return total number of items (function should return the total count) and loaded items count
renderNoItems
() => JSX.Element
data
List of items to render. This can either be an array of objects or a function that will generate the array of objects. If you supply a function then pagination will be supported. The function expects 2 parameters - max
and last
and returns a promise that will resolve to the list of objects. max
specifies the maximum number of items to be returned.
Array | IDataFunction
renderItem
A function that will be responsible for rendering each individual element of the list. It is common to return ItemCard
component from here.
(item: any, key: number) => JSX.Element
pageSize
The number of items to fetch in each page. This gets passed to the data function as the max
parameter
number
args
any
renderLoading
This function renders a loading animation. If not specified, the default loading animation will be used.
() => JSX.Element
className
Any extra class names to be added to the component
string
showFooter
show/hide footer (scroll buttons)
boolean
scrollStep
mun of rows to scroll
number
showEndOfContent
show/hide end of content message
boolean
onItemsLoad
this function will be called every time list get updated this will return total number of items (function should return the total count) and loaded items count
(total: number, loaded: number, items?: any[]) => void
renderNoItems
() => JSX.Element
Last updated