Interface HeadlessScrollbarProps

Props of the useScrollbar hook.

interface HeadlessScrollbarProps {
    containerRef: RefObject<Element>;
    deactivateDelay?: number;
    getTrackRect: (() => undefined | DOMRect);
    handleMargin?: number;
    onScroll?: ((info: Readonly<ScrollbarInfo>) => void);
    orientation?: "vertical" | "horizontal";
}

Properties

containerRef: RefObject<Element>

A reference to a scrollable container element.

deactivateDelay?: number

A delay after which scrollbar is deactivated.

3000
getTrackRect: (() => undefined | DOMRect)

Returns a bounding rect of a track.

handleMargin?: number

Minimum distance between a scrollbar track bounds and a scrollbar handle in the direction of a scrollbar orientation.

0
onScroll?: ((info: Readonly<ScrollbarInfo>) => void)

A handler that is called when a container is being scrolled.

Type declaration

    • (info): void
    • Parameters

      • info: Readonly<ScrollbarInfo>

        An info about the current state of a scrollbar. The info object is reused between handler invocations.

      Returns void

orientation?: "vertical" | "horizontal"

The orientations of a scrollbar track along which a scrollbar handle can be dragged.

"vertical"