hiding-header-react
Version:
Toggles header visibility on scroll.
32 lines (31 loc) • 1.49 kB
TypeScript
import { HidingHeaderOptions } from 'hiding-header';
import { ElementType, HTMLAttributes, ReactNode, type FunctionComponent } from 'react';
export declare const useHidingHeader: () => {
run: () => void;
pause: () => void;
isPaused: () => boolean;
isHome: () => boolean;
reveal: () => void;
hide: () => void;
getHeight: () => number;
getVisibleHeight: () => number;
destroy: () => void;
} | undefined;
export declare const useRunHidingHeader: () => (() => void) | undefined;
export declare const usePauseHidingHeader: () => (() => void) | undefined;
export declare const useRevealHidingHeader: () => (() => void) | undefined;
export declare const useHideHidingHeader: () => (() => void) | undefined;
export interface HidingHeaderProps {
children?: ReactNode;
className?: HTMLAttributes<HTMLDivElement>['className'];
innerClassName?: HTMLAttributes<HTMLDivElement>['className'];
component?: ElementType;
heightPropertyName?: HidingHeaderOptions['heightPropertyName'];
boundsHeightPropertyName?: HidingHeaderOptions['boundsHeightPropertyName'];
animationOffsetPropertyName?: HidingHeaderOptions['animationOffsetPropertyName'];
snap?: HidingHeaderOptions['snap'];
onHeightChange?: HidingHeaderOptions['onHeightChange'];
onVisibleHeightChange?: HidingHeaderOptions['onVisibleHeightChange'];
onHomeChange?: HidingHeaderOptions['onHomeChange'];
}
export declare const HidingHeader: FunctionComponent<HidingHeaderProps>;