Skip to Content
Docs🏗️ ⏐ ComponentsDataInfinity List

Infinity List

The Infinity List component is designed to manage large datasets by progressively displaying a subset of items, enhancing performance and user experience.

This component is especially useful in scenarios where loading the entire dataset at once is feasible, but displaying it all at once may overwhelm the user or the UI.

Quick Start

To start using the InfinityList component, import useInfinityList from the reablocks library and provide the items prop to the hook.

Examples

The basic implementation uses the InfinityList component directly. This approach is straightforward, allowing you to map over your dataset and render each item within the InfinityList component:

Component

Hook

API

NameTypeDefault
childrenany

The children to filter.

buttonClassNamestring

CSS Classname to apply to the button.

sizenumber

The page size. Combined with the threshold, this will determine the page size.

10
thresholdnumber

The fuzzy threshold to use when calculating the next page size.

3
nextSizenumber

The numer of items to show in the next page. If undefined, will use the size. If you want to show all items, pass infinity.

Last updated on