Skip to content

Scroll Area

Augments native scroll functionality for custom, cross-browser styling and supports virtual scrolling for large lists.

Component Features

  • Custom scrollbar styling across all browsers.
  • Supports vertical, horizontal, or both directions.
  • Smooth scrolling support.
  • Scroll position and edge detection events.
  • Virtual Scrolling support for rendering massive lists efficiently.

Both Directions

Ornella Binni
Photo by Ornella Binni
Tom Byrom
Photo by Tom Byrom
Vladimir Malyavko
Photo by Vladimir Malyavko
Example

Smooth Scroll & Events

Section 1
Section 2
Section 3
Example

With Table

Recent Orders

Invoice
Status
Method
Amount
INV001PaidCredit Card$213.44
INV002PaidCredit Card$784.70
INV003PaidCredit Card$571.80
INV004PaidCredit Card$31.29
INV005PaidCredit Card$333.08
INV006PaidCredit Card$377.41
INV007PaidCredit Card$497.06
INV008PaidCredit Card$816.27
INV009PaidCredit Card$880.06
INV0010PaidCredit Card$275.88
INV0011PaidCredit Card$322.44
INV0012PaidCredit Card$109.19
INV0013PaidCredit Card$551.71
INV0014PaidCredit Card$747.28
INV0015PaidCredit Card$695.92
Example

Infinite Scroll

Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 8
Item 9
Item 10
Item 11
Item 12
Item 13
Item 14
Item 15
Item 16
Item 17
Item 18
Item 19
Item 20
Example

Virtual Scrolling

You can enable virtual scrolling to render lists with thousands of items without performance issues.

Example

API

Props

NameTypeDefaultDescription
type'auto' | 'always' | 'scroll' | 'hover''hover'Describes the nature of scrollbar visibility.
direction'vertical' | 'horizontal' | 'both''vertical'The direction of the scroll area.
smoothbooleanfalseEnables smooth scrolling behavior.
scrollThresholdnumber0Distance in pixels from the edge to trigger infinite scroll events.
virtualScrollbooleanfalseEnables virtual scrolling mode.
itemsany[][]Array of items to render when virtual scrolling is enabled.
itemHeightnumber40Fixed height of each item in pixels for virtual scrolling.

Events

NameParametersDescription
scroll-position(position: { x: number; y: number })Emitted when scrolling occurs, providing current coordinates.
scroll-top-Emitted when scrolled to the top edge (considering threshold).
scroll-bottom-Emitted when scrolled to the bottom edge (considering threshold).
scroll-left-Emitted when scrolled to the left edge (considering threshold).
scroll-right-Emitted when scrolled to the right edge (considering threshold).

Slots

NameScopeDescription
default-The main content to be scrolled.
item{ item: any, index: number }Custom template for each item in virtual scroll mode.