Skip to content
masterclass Buddy

TanStack · Method

virtualizer.scrollToIndex

scrollToIndex scrolls a TanStack Virtualizer to a selected item. You can control the item's alignment and use normal or smooth scrolling.

Last updated

Syntax

scrollToIndex(index: number, options?: { align?: 'start' | 'center' | 'end' | 'auto'; behavior?: 'auto' | 'smooth' }): void

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • Virtualizer
  • scrollToOffset
  • scrollBy
  • scrollToEnd
  • getVirtualItems
  • getVirtualIndexes

Source: Virtualizer | TanStack Virtual Docs. Checked 2026-11-03.