Hooks

useScrollDirection

Publisher

cermuel

50 hooks published

More from this publisher

useScrollDirection

Detect upward or downward scrolling.

useScrollDirection.tsx
import { useScrollDirection } from "@cermuel/hooks/react";export function useScrollDirectionExample() {  const direction = useScrollDirection();  return <p>{direction}</p>;}

Props

Param
Type
Default Value
target?
MaybeTarget<Element | Window>

Returns

Direction