ScrollDirection
typeSource L11Type contract for ScrollDirection.
type ScrollDirection = "up" | "down" | "left" | "right" | nullOpen-code aq-ui React hook for Use Scroll Direction.
pnpm dlx aq-ui@alpha add use-scroll-directionImport the parts you need, then jump to an export for its contract.
"use client"
import { useScrollDirection } from "@/hooks/use-scroll-direction"
const result = useScrollDirection()Type contract for ScrollDirection.
type ScrollDirection = "up" | "down" | "left" | "right" | nullOpen-code aq-ui React hook for Use Scroll Direction.
function useScrollDirection(target?: Target<Element | Window>, { threshold = 4, axis = "y" }: UseScrollDirectionOptions = {}): ScrollDirectionScrollDirection| Name | Type | Default |
|---|---|---|
target? | Target<Element | Window> | — |
options? | UseScrollDirectionOptions | {} |
Type contract for UseScrollDirectionOptions.
interface UseScrollDirectionOptions| Name | Type | Default |
|---|---|---|
threshold? | number | 4 |
axis? | "x" | "y" | "both" | "y" |
hook-target, use-scroll-position