Skip to content
Theme:

Ui3nVirtualScroll ​

Virtual scroll component for efficiently rendering large lists by only rendering visible items.

Props

NameTypeDefaultDescription
items*T[] —

List of items to render

minChildHeight*number16

Minimum height of child element

renderAheadnumber | undefined20

Number of items to render ahead

stickToBottomboolean | undefinedfalse

When true, if the user is near the bottom of the list, keep the viewport stuck to the bottom after items update (typical chat behavior). Default: false.

stickToBottomThresholdnumber | undefined32

Distance from the bottom (px) treated as "near bottom" for stickToBottom. Default: 32.

reachEdgeThresholdnumber | undefined64

Distance from an edge (px) at which 'reached-top' / 'reached-bottom' fire. Default: 64.

Events

Event NameArguments / Value TypeDescription
scrollEvent —
reached-top

The list has been scrolled close to its top - the moment to load a previous page of items. Fires once per approach: it will not repeat until the list leaves the edge or 'items' change.

reached-bottom

Same as 'reached-top', for the bottom edge.

Slots

Slot NameScope Props (v-slot)Description
#item{ value: T; index: number; }

Item slot

Usage Examples ​

Simple virtual scroll ​

Simple virtual scroll

Basic virtual scroll with large list

Virtual scroll with custom rendering ​

Virtual scroll with custom rendering

Virtual scroll with custom item template