Optional
props: StaticProps & MutablePropsProtected
Optional
_addTimeout for scroll action
Protected
_callbacksCallbacks instance
Protected
_destroyableStores actions that need to be executed when the module is destroyed
Protected
_isTracks whether the module has been destroyed
Protected
_outerScrollbar outer element.
Protected
_prevPrevious scroll value
Protected
_propsCurrent properties
Protected
Optional
_removeTimeout for scroll action
Protected
_thumbScrollbar thumb element (draggable handle).
Protected
_trackScrollbar track element (the container of the thumb).
Protected
_valueSave scroll value on swipe start
Scroll axis
Retrieves the module's callbacks instance.
The element to which the scrollbar is applied.
Checks if the module has been destroyed.
The name of the module, derived from the class name
Scrollbar outer element
The element where the scrollbar is appended.
If parent
is not set, it defaults to container
or document.body
(if applied to window
).
Optional prefix for classnames used by the module
Current properties. Do not mutate these directly, use updateProps
instead.
Returns the total scrollable distance.
The actual scrollable element.
Returns document.documentElement
for window
, otherwise the container
itself.
Returns the total scroll width/height of the content.
Returns scrollTop or scrollLeft of the scrollable element.
Scrollbar thumb element (draggable handle).
Returns the current thumb size.
Scrollbar track element (the container of the thumb).
Returns the current track size.
Protected
_addAdds a class name on an element, and keeps track of it for removal when the module is destroyed.
The target DOM element.
The class name to toggle.
Protected
_cnHelper function to generate classnames with the module's prefix.
The class names to generate.
A string of class names with the module's prefix applied.
Protected
_createCreate elements
Protected
_createCreate outer element
Protected
_createCreate thumb element
Protected
_createCreate track element
Protected
_destroyDestroys the component and cleans up resources.
Get default mutable properties.
Get default static properties.
Protected
_handleHandles property mutations
Protected
_onHandle scroll update
Protected
_onProtected
_renderRender the scrollbar.
Protected
_setSet scroll events
Protected
_setSet resize events
Protected
_setSet swipe events
Destroys the module, cleaning up resources, callbacks, and event listeners.
Adds a custom callback to the module.
The event type to listen for (e.g., 'props', 'destroy').
The function to execute when the event is triggered.
Additional settings for the callback.
Adds a callback on the module's destruction.
The function to execute during destruction.
Resize the scrollbar.
A custom scrollbar component. Supports both
window
andHTMLElement
containers.Documentation