Used to replace the browser's native scrollbar.

Basic usage

Horizontal scroll

Max height

Manual scroll

Scrollbar Attributes

AttributeDescriptionTypeAccepted ValuesDefault
heightheight of scrollbarstring / number
max-heightmax height of scrollbarstring / number
nativewhether to use the native scrollbar stylebooleanfalse
wrap-stylestyle of warp containerstring
wrap-classclass of warp containerstring
view-stylestyle of viewstring
view-classclass of viewstring
noresizedo not respond to container size changes, if the container size does not change, it is better to set it to optimize performancebooleanfalse
tagelement tag of the viewstringdiv
alwaysalways show scrollbarbooleanfalse
min-sizeminimum size of scrollbarnumber20

Scrollbar Events

Event NameDescriptionParameters
scrolltriggers when scrollingdistance of scrolling { scrollLeft, scrollTop }

Scrollbar Methods

setScrollTopSet distance to scroll top(scrollTop: number)
setScrollLeftSet distance to scroll left(scrollLeft: number)
updateupdate scrollbar state manually

Scrollbar Slots

customize default content