Scrollbar

Provide styled scroll areas with programmatic scroll control.

Scrollbar

Default

Used to replace the browser’s native scrollbar.

Use height property to set the height of the scrollbar, or if not set, it adapts according to the parent container height.

Code copied

Horizontal scroll

When the element width is greater than the scrollbar width, the horizontal scrollbar is displayed.

Code copied

Max height

The scrollbar is displayed only when the element height exceeds the max height.

Code copied

Api

PROPS

PropertyTypeValuesDescriptiondefaultExampleMore
heightString, Numbernumberheight of scrollbar
max-heightString, Numbernumbermax height of scrollbar
nativeBooleantruefalsewhether to use the native scrollbar
wrap-styleString, Object, ArrayCSSPropertiesCSSProperties[]string[]style of wrap container
wrap-classStringstringclass of wrap container
view-styleString, Object, ArrayCSSPropertiesCSSProperties[]string[]style of view container
view-classStringstringclass of view container
noresizeBooleantruefalsedo not respond to container size changes, if the container size does not change, it is better to set it to optimize performance
tagstringHTML Tagelement tag of the viewdiv
alwaysBooleantruefalsealways show scrollbartrue
min-sizeNumberminimum size of scrollbar20
thicknessNumber, Stringnumberthumb width6
No matching data

SLOTS

PropertyTypeValuesDescriptiondefaultExampleMore
defaultslotcustomize default content
No matching data

EVENTS

PropertyTypeValuesDescriptiondefaultExampleMore
scrollfunction({ scrollLeft: numberscrollTop: number }) => voidtriggers when scrolling, return distance of scrolling
No matching data

EXPOSES

PropertyTypeValuesDescriptiondefaultExampleMore
handleScrollfunction() => voidhandle scroll event
scrollTofunction(options: ScrollToOptions | numberyCoord?: number) => voidscrolls to a particular set of coordinates
setScrollTopfunction(scrollTop: number) => voidSet distance to scroll top
setScrollLeftfunction(scrollLeft: number) => voidSet distance to scroll left
updatefunction() => voidupdate scrollbar state manually
wrapRefobjectRef HTMLElementscrollbar wrap ref
No matching data
Last Updated: 2026-08-17, 08:33:54