Interface ScrollbarConfig

interface ScrollbarConfig {
    autoHide?: number;
    className?: string | string[];
    clickScroll?: boolean;
    dragScroll?: boolean;
    hideNative?: boolean;
    id?: string;
    onMobile?: boolean;
    positionH?: Anchor;
    positionV?: Anchor;
    useHandle?: boolean;
}

Properties

autoHide?: number

Auto-hide the scrollbar when there's no scrolling happening for the given number of milliseconds.

Set to 0 or a negative value to disable hiding.

className?: string | string[]

A class name or a list of class names to set on the scrollable element. Will result in the scrollable element getting these classes. This is useful if the scrollable is a wrapper created by us and you want it to be assigned classes.

See explanation for id.

undefined
clickScroll?: boolean

Whether to scroll the element when a user clicks anywhere on the scrollbar.

dragScroll?: boolean

Whether to scroll the element when a user drags the handle (if useHandle) or drags along anywhere on the scrollbar (if not useHandle).

hideNative?: boolean

Hide the native scroll bar.

Note that the LISN scrollbar is itself draggable/clickable so it can be used to scroll the element similar to the native scrollbar.

id?: string

The DOM ID to set on the scrollable element. Will result in the scrollable element getting this ID. This is useful if the scrollable is a wrapper created by us and you want it to be assigned an ID.

IMPORTANT: If the scrollable is the the main scrolling element or if you've disabled content wrapping, then the scrollable element provided as the widget element will not have its content wrapped and will remain the actual scrollable. In this case, its ID will be set to this, so if it already has an ID, it will be overridden with this value.

undefined
onMobile?: boolean

Whether to enable also on mobile and tablet devices. Detection is based on user agent.

positionH?: Anchor

Where to place the scrollbar that tracks the horizontal scroll.

It does not need to be a horizontal position; it can for example be "left" or "right".

positionV?: Anchor

Where to place the scrollbar that tracks the vertical scroll.

It does not need to be a vertical position; it can for example be "top" or "bottom".

useHandle?: boolean

Whether to use a traditional fixed-length handle (like the native scrollbar) to indicate the position or the default style of a fill (that starts at the beginning and ends at the scroll fraction).