SSE Hooks

useScrollLock

A custom hook that locks and unlocks scroll.

Installation

npx sse-tool add use-scroll-lock

Usage

import { useScrollLock } from "./{hooks file}";

// Lock the scroll when the modal is mounted, and unlock it when it's unmounted
useScrollLock();

API

Parameters

NameTypeDescription
optionsUseScrollLockOptionsOptions to configure the hook, by default it will lock the scroll automatically.

Return Value

Returns UseScrollLockReturn.

  • An object containing the lock and unlock functions.

Changelog

c165d — feat: enhance useRoleGuard and useSSR hooks with additional options and documentation

30da4 — feat: add new hooks and their metadata

cf13e — feat: add custom hooks for step navigation, ternary dark mode, timeout, toggle, unmount, and window size

Built with Love • © 2026