InfiniteScrollArea

InfiniteScrollArea is a component that provides infinite scrolling functionality. This component offers a smooth scrolling experience by automatically loading and displaying the next dataset when the end of the component is reached.

Usage

import { InfiniteScrollArea } from "@yamada-ui/react"
<InfiniteScrollArea />

Specify the Viewport

To specify the viewport, set a ref to rootRef.

Set rootMargin

To set rootMargin, assign a string to rootMargin.

Set threshold

To set threshold, assign a number to threshold.

Initial Load

To load initially, set initialLoad to true. By default, initialLoad is set to false, and the initial(index=0) onLoad is not executed.

true: The first onLoad is executed regardless of the scroll amount, and the provided index starts from 0.
false: onLoad is executed when a certain scroll is reached, and the provided index starts from 1.

Change the Starting index

To change the starting index, set a number to startIndex. The default is 1.

Change the Orientation

To change the orientation, set orientation to either "vertical" or "horizontal". The default is "vertical".

Reverse

To reverse, set reverse to true. The default is false.

Disable

To disable, set disabled to true. This is useful when you do not want to execute onLoad in response to scrolling under certain conditions.

Reset

To reset the index, set a ref to resetRef. A callback function is attached to the set ref, so execute it.

Display an Element at the End of the Scroll

To display an element at the end of the scroll, set a ReactNode to finish.

Customize the Trigger

To customize the trigger, set props to triggerProps.

Customize the Loading

To customize the loading, set a ReactNode to loading.

Props