@stihl-design-system/components
Version:
Welcome to the STIHL Design System react component library.
10 lines (9 loc) • 417 B
TypeScript
export type ScrollDirection = 'up' | 'down';
/**
* Custom React hook to determine the current scroll direction of the window.
*
* @param {number} [threshold=0] - The minimum change in scroll position in px required to update the direction.
* @returns {ScrollDirection} - The current scroll direction, either 'up' or 'down'.
*
*/
export declare const useScrollDirection: (threshold?: number) => ScrollDirection;