@stanfordspezi/spezi-web-design-system
Version:
Stanford Biodesign Digital Health Spezi Web Design System
17 lines (16 loc) • 494 B
TypeScript
/**
* Tracks whether the user has scrolled past a specified threshold.
*
* This hook is useful for showing/hiding navigation elements, implementing scroll-to-top
* buttons, or triggering animations based on scroll position.
*
* @example
* ```tsx
* // Triggers after scrolling 100px
* const hasScrolledPastHeader = useIsScrolled(100);
*
* // Triggers on any scroll
* const isScrolled = useIsScrolled(0);
* ```
*/
export declare const useIsScrolled: (threshold: number) => boolean;