Skip to main content

Start from a certain item

The initialTopMostItemIndex property changes the initial location of the list to display the item at the specified index. You can pass in an object to achieve additional effects similar to scrollToIndex.

Note: The property applies to the list only when the component mounts. If you want to change the position of the list afterward, use the scrollToIndex method.

Live Editor
function App() {
  return (
    <Virtuoso
      style={{ height: 400 }}
      totalCount={1000}
      initialTopMostItemIndex={800}
      itemContent={(index) => (<div style={{ height: 30 }}>Item {index}</div>)}
    />
  )
}
Result
Loading...