UNPKG

@supunlakmal/hooks

Version:

A collection of reusable React hooks

13 lines (12 loc) 517 B
interface ScrollToTopOptions { behavior?: ScrollBehavior; } /** * Custom hook that provides a function to scroll the window to the top. * * @param {ScrollToTopOptions} [options] - Optional configuration for the scroll behavior. * @param {'auto' | 'smooth'} [options.behavior='auto'] - Defines the transition animation. * @returns {() => void} A function that scrolls the window to the top when called. */ export declare const useScrollToTop: ({ behavior, }?: ScrollToTopOptions) => (() => void); export {};