Scroll
The scrolling primitives. ScrollView is the scrollable region; Sticky and VirtualList are components that only make sense inside one.
The pieces
| Component | Use it for |
|---|---|
| ScrollView | A container that scrolls when its content overflows. |
| Sticky | An element that pins to a scroll container's edge. |
| VirtualList | A list with a virtualisation seam for long datasets. |
A scroll context, and what lives in it
ScrollView establishes a scroll context — an overflow: auto region with momentum scrolling and
contained overscroll. Both other components depend on that context: Sticky pins to its edges,
and VirtualList renders its rows inside one.
You can use any overflow: auto ancestor as the scroll context — ScrollView is not special to
Sticky. But reaching for ScrollView makes the relationship explicit and brings the
quality-of-life defaults.
VirtualList stays dependency-free
Virtualisation — rendering only the visible rows of a long list — has a real implementation cost,
and motif does not want to bundle a windowing library every app pays for. VirtualList solves
this with a seam: short lists render every row directly, and long lists delegate to whatever
implementation you register at startup. Most apps wire react-virtuoso into the seam once; apps
with only short lists never install anything.