Skip to content
aq-ui
Back to HooksHook

Use Scroll Lock

Open-code aq-ui React hook for Use Scroll Lock.

Installation

pnpm dlx aq-ui@alpha add use-scroll-lock

API reference

Client module

Import the parts you need, then jump to an export for its contract.

View full source

Quick start

"use client"

import { useScrollLock } from "@/hooks/use-scroll-lock"

const result = useScrollLock()

useScrollLock

functionSource L14

Open-code aq-ui React hook for Use Scroll Lock.

function useScrollLock(enabled = true, target?: Target<HTMLElement>): void
Returns
void

Parameters

NameTypeDefault
enabled?—true
target?Target<HTMLElement>—
const result = useScrollLock()

Registry dependencies

hook-target, use-isomorphic-layout-effect

Files

  • hooks/use-scroll-lock.ts

Source