API Reference
React
LoadMoreTrigger

LoadMoreTrigger

This component renders the onLoadMore trigger area. Should be only used headlessly.

import * as React from 'react';
import { Grid, useGrid } from '@virtual-grid/react';
 
const Page = () => {
  const ref = React.useRef<HTMLDivElement>(null);
 
  const grid = useGrid({
    scrollRef: ref,
    count: 1000
    // ...
  });
 
  return (
    <div ref={ref} style={{ height: '400px', overflow: 'auto' }}>
      // ...
      <LoadMoreTrigger {...grid.getLoadMoreTrigger()} />
    </div>
  );
};
OptionTypeRequiredDescription
position'top' | 'bottom' | 'left' | 'right'NoDefault = 'bottom'
Position of the trigger
sizenumberNoDefault = 0
Size of the trigger
onLoadMorefunctionNoCallback function when the trigger is visible
styleCSSPropertiesNoApply custom styles
classNamestringNoApply custom classes