Virtual scrolling swaps a full DOM list for a fixed-height window β only the rows in (and just around) the viewport are rendered, so opening and scrolling stay fast no matter how many options you feed in.
- It auto-enables once the option count passes
virtual-scroll-threshold(default100). You can also force it on withenable-virtual-scroll="true". - It requires a fixed
option-heightβ the component uses index math on that height to place rows, so the row you want doesn't have to be rendered yet. virtual-scroll-bufferrenders a few extra rows above and below the viewport to keep fast scrolling flicker-free.- The same technique applies to the selected-items popover for very large
selections (paired with
badge-height).
VS01 15,000 options
A flat list of 15,000 items β try scrolling, searching, and the jump buttons.
Controls
Quick usage
enable-virtual-scroll+ a fixedoption-heightare all the demo needs; the 15,000 rows are assigned imperatively viael.options.- The v2.0.0 scroll-to API (
scrollToIndex/scrollToValue) locates the target by index math, so it works even though the target row isn't currently rendered β jumping to the last of 15,000 items is instant. Each handler callsel.open()first so there's a scroll container to move. - Raise
option-heightfor taller rows, or growvirtual-scroll-bufferif you see any flicker while scrolling fast.